-
Notifications
You must be signed in to change notification settings - Fork 81
Closed
Description
using SQLite
db = SQLite.DB("test.sqlite")
SQLite.execute!(db, "CREATE TABLE IF NOT EXISTS tbl(a INTEGER);")
stmt = SQLite.Stmt(db, "INSERT INTO tbl (a) VALUES (@a);")
SQLite.bind!(stmt, "@a", 1)
This code produces the following output:
$ julia bug.jl
ERROR: LoadError: MethodError: `bind!` has no method matching bind!(::SQLite.Stmt, ::Int32, ::Int64)
Closest candidates are:
bind!(::SQLite.Stmt, !Matched::AbstractString, ::Any)
bind!(::SQLite.Stmt, !Matched::Int64, ::Int64)
bind!(::SQLite.Stmt, !Matched::Int64, ::Any)
...
in bind! at /home/someone/.julia/v0.4/SQLite/src/SQLite.jl:122
while loading /home/someone/bug.jl, in expression starting on line 5
It seems that the function sqlite3_bind_parameter_index()
returns an Int32
value as a translated index for the named parameter @a
, and thus the function bind!()
rejects the argument.
I think we need to convert the translated index into an Int64
value or make bind!()
accept an Int32
index as the second argument.
Metadata
Metadata
Assignees
Labels
No labels