lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I'm using lsqlite3 with prepared statements like (simplified example):

local stmt = db:prepare("INSERT INTO items (x, y, z) VALUES (?, ?, ?)")
stmt:bind_values(a, b, c)
stmt:step()
stmt:finalize()

The problem is if, for example, a is nil and x is a numeric, nullable
type such as INTEGER, x ends up being not null but zero. Seemingly the
only way to actually insert null is to explicitly specify it in the
query, instead of as a parameter, which kinda defeats the purpose of
parameters. Is there some workaround?

-- 
Sent from my toaster.