Gambit FFI implementation of minimal SQLite3 interface Lassi Kortela (31 Aug 2020 08:52 UTC)
Re: Gambit FFI implementation of minimal SQLite3 interface Lassi Kortela (02 Sep 2020 05:33 UTC)
Do we need to support positional parameters to SQL prepared statements? Lassi Kortela (02 Sep 2020 05:44 UTC)
Re: Gambit FFI implementation of minimal SQLite3 interface Lassi Kortela (02 Sep 2020 07:33 UTC)

Do we need to support positional parameters to SQL prepared statements? Lassi Kortela 02 Sep 2020 05:44 UTC

> Would it be a problem to leave out support for positional parameters
> entirely?

Just realized that if a Scheme program supplies named parameters as an
alist or plist, where the keys are symbols or strings, we could use
integer keys to supply positional parameters.

(sql-do '("insert into foo values (@bar, @baz, ?)"
           bar 1
           baz 2
           0   3))

It would work but it's not that clear. Anyway, mixing positional and
named parameters ought to be quite rare so maybe it's not a big deal in
practice if we support both that way. Since the positionals look kind of
ugly, it would also incentivize people to prefer named parameters.