class DuckDB::PreparedStatement
def bind_timestamp(index, value)
# or you can specify timestamp string.
stmt.bind(1, Time.now)
stmt = PreparedStatement.new(con, sql)
sql ='SELECT name FROM users WHERE created_at = ?'
con = db.connect
db = DuckDB::Database.open('duckdb_database')
require 'duckdb'
The second argument value is to expected time value.
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_timestamp(index, value) time = _parse_time(value) _bind_timestamp(index, time.year, time.month, time.day, time.hour, time.min, time.sec, time.usec) end