* Allow unused named parameters
Try to bind all named parameters and ignore those not used.
* Allow "@" and "$" for named parameters
* Add tests for named parameters
Co-authored-by: Guido Berhoerster <guido+go-sqlite3@berhoerster.name>
Once the regex encountered the first instance of a non-match, it would return without processing the rest of the rows in the statement. This change allows it to process the remaining, only setting the sqlite3_result_int to zero then continuing. This worked fine for the example as it only had one item to process.
* adding SystemErrno to Error, and fixing error logic when open fails
* fix for old versions of libsqlite3 that do not have sqlite3_system_errno defined
* fixing pre-processor logic
[why]
see https://github.com/mattn/go-sqlite3/issues/607
SQLite default journal mode is DELETE, but forcing it on open causes "database is locked"
if other connection exists with WAL mode, for example.
[how]
Don't set DELETE mode if not set in DSN explicitly.
[testing]
Run tests in my project where WAL mode is used.
[why]
Context cancellation goroutine is not in sync with Next() method lifetime.
It leads to sql.ErrNoRows instead of context.Canceled often (easy to reproduce).
It leads to interruption of next query executed on same connection (harder to reproduce).
[how]
Do query in goroutine, wait when interruption done.
[testing]
Add unit test that reproduces error cases.
When building on darwin with the `libsqlite3` tag, go-sqlite3 adds the
homebrew library path. It does not, however, add the homebrew include
path, which means that the MacOS sqlite3 header is used instead. On
my system, this results in build errors that look like this:
./sqlite3_load_extension.go:25:8: could not determine kind of name for C.sqlite3_enable_load_extension
./sqlite3_load_extension.go:33:8: could not determine kind of name for C.sqlite3_load_extension
Add the homebrew include path as well, so that he header matches the
libraries we're using.
Signed-off-by: George Dunlap <george.dunlap@citrix.com>