class DuckDB::PreparedStatement
def bind_date(index, value)
# or you can specify date string.
stmt.bind(1, Date.today)
stmt = PreparedStatement.new(con, sql)
sql ='SELECT name FROM users WHERE birth_day = ?'
con = db.connect
db = DuckDB::Database.open('duckdb_database')
require 'duckdb'
The second argument value is to expected date.
The index of first parameter is 1 not 0.
The first argument is index of parameter.
binds i-th parameter with SQL prepared statement.
def bind_date(index, value) date = _parse_date(value) _bind_date(index, date.year, date.month, date.day) end