Commit Graph

136 Commits

Author SHA1 Message Date
Oliver Giles f1eef49b3f TestQueryer: actually check Rows returned
Fixes a test which did not correctly exercise the multi-statement
Queryer functionality
2022-08-16 21:24:19 +09:00
Phil Eaton 3ccccfb4c9
Support returning any from callbacks (#1046)
Support returning any from callbacks
2022-05-29 21:06:43 -04:00
Ben Johnson ae2a61f847 Add sqlite3_file_control() support
This commit adds the SQLiteConn.FileControlInt() method which calls the
underlying sqlite3_file_control() function with an int argument. This can
be used for low-level operations on SQLite databases such as persisting
the WAL file after database close.
2022-01-29 01:58:27 +09:00
Evan Jones a4fc68a6cb
sqlite3_test.go: Fix go test -run=...: Use standard sub-tests (#881)
Selecting only some tests with go test -run=... does not work, because
some of the tests are executed using testing.RunTests(). That function
is documented as "an internal function". This changes TestSuite to use
the testing subtests feature instead.

This has a behaviour change: the benchmarks now need to be
selected at the command line with the standard go test -bench=.
flag. This will also set up the test database twice when running
benchmarks, rather than once.
2021-10-26 00:24:46 +09:00
Michael Hofmann 98d34f9dc5
Use single-quotes around string literals. (#934) 2021-10-26 00:09:24 +09:00
Aviv Klasquin Komissar 3900dc3187
return non-nil result when calling exec with empty query (#973)
fixes #963
2021-10-19 18:18:21 +09:00
Jesse Rittner ab91e9342b make column metadata functionality opt-in 2021-02-18 13:34:41 -05:00
Philip O'Toole 95e88ca693
Export sqlite3_column_table_name (#900) 2021-02-18 11:58:21 +09:00
mattn 1fbedab173
Support vfs for Open (#877)
Closes #876
2020-11-17 01:54:21 +09:00
Evan Jones 70c77097f2
sqlite3_test.go: Move Go 1.13 test to sqlite3_go113_test.go (#883)
Commit 4f7abea96e added a test that uses Conn.Raw, which was added in
Go >= 1.13. The go-sqlite3 project runs tests with Go >= 1.11. Remove
the test from sqlite3_test.go, so it only runs with the correct
versions of Go.

Instead of adding a new test, modify the existing test that already
uses Conn.Raw() to check the type of driverConn.
2020-11-17 01:52:26 +09:00
Evan Jones 4f7abea96e
doc.go: you can use Conn.Raw to get *SQLiteConn (#882)
This can be easier that registering a new driver, in some cases.
Add a test to verify that this works.
2020-11-16 23:42:00 +09:00
gber db4c9426f8
Enable all prefixes for named parameters and allow for unused named parameters (#811)
* 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>
2020-05-14 23:28:04 +09:00
rittneje b4f5cc77d1 add SystemErrno to Error (#740)
* 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
2019-12-17 15:58:28 +09:00
Yasuhiro Matsumoto fc06e55305
Add build constraints for non cgo 2019-11-18 18:03:31 +09:00
MichaelS11 57484d0899 Updated Ping to return ErrBadConn
Added TestOpenContext
Added TestFileCopyTruncate
Added ping to doTestOpen
2019-06-19 16:50:49 -07:00
Yasuhiro Matsumoto 4731d0e6ab
Print type of result 2019-02-11 01:36:01 +09:00
Yasuhiro Matsumoto 5e7aedf685
Add test 2019-02-11 00:48:49 +09:00
Jesse Rittner 2fe51daa56 fixed typo 2018-12-08 08:39:01 -05:00
Jesse Rittner 5846e1aa22 adding unit test 2018-12-08 08:31:45 -05:00
mattn 873ec57005
Merge pull request #643 from akalin/zero-length-blob
Distinguish between NULL and zero-length blobs on query
2018-11-22 01:48:38 +09:00
Mario Trangoni c46327f585 sqlite3_test.go: Simplify return err 2018-11-21 11:31:05 +01:00
Frederick Akalin 3955886e38 Add fatal message 2018-09-22 11:50:52 -07:00
Frederick Akalin d61fdcd55b Clean up test 2018-09-22 11:26:20 -07:00
Frederick Akalin 568d682daa Add failing test 2018-09-22 11:26:20 -07:00
Frederick Akalin 25a6a28602 Actually check the value of RunTests 2018-09-22 11:26:08 -07:00
Grzegorz Marszałek e30f9ffa3a implementation of set_authorizer interface 2018-08-25 20:25:16 +02:00
Yoann Cerda d31a44a0bd Use t.Skip for TestUpsert to be compliant with the actual cade base. 2018-06-12 13:55:59 +02:00
Yoann Cerda 2439c84c29 fix upsert log typos. 2018-06-12 13:55:59 +02:00
Yoann Cerda a06d1c9512 bump sqlite3 3.24.0 and add TestUpsert. 2018-06-12 13:55:59 +02:00
Gert-Jan Timmer 62b7bd5f54 fix/118
* Added TestMultiBlobs
* Removed dead code

Fixes #118
2018-06-12 11:06:00 +02:00
Lucas Manuel Rodriguez 140b80506d Add zero-length slice test 2018-05-31 08:22:26 -03:00
Lucas Manuel Rodriguez 8d6d326be6 Add nil check in bind and a test 2018-05-30 21:39:01 -03:00
mattn 397c95cd5e
Merge pull request #549 from mjtrangoni/fix-linter-issues
Fix linter issues
2018-04-17 22:17:04 +09:00
Mario Trangoni b75aefcf46 fix small codespell issue 2018-04-17 12:33:03 +02:00
Mario Trangoni 28e6f6d675 fix all gosimple issues 2018-04-17 12:21:29 +02:00
Kenneth Shaw 7174000f77 Move RegisterAggregator implementation
The SQLiteConn.RegisterAggregator implementation was defined in
sqlite3_trace.go file, which is guarded with a build constraint. This
change simply moves RegisterAggregator to the main sqlite3.go file,
and moves accompanying unit tests.

The rationale for this move is that it was not possible for downstream
using packages to use RegisterAggregator without also specifying (and
notifying the user) the 'trace' build tag.
2017-11-05 09:18:06 +07:00
mattn 132eeedb4a Merge branch 'master' into master 2017-08-30 19:57:18 +09:00
Greg Holt b1c8062c18 Improved TestNilAndEmptyBytes
I forgot that bytes.Equals treats nil and []byte{} as equal.
2017-08-21 13:46:00 -07:00
Greg Holt d1772f0826 Added TestNilAndEmptyBytes 2017-08-21 13:22:09 -07:00
Yasuhiro Matsumoto 6654e412c3 fix test 2017-08-02 02:06:40 +09:00
Yasuhiro Matsumoto 7133e5d7f5 ignore errors in teardown 2017-08-02 01:49:00 +09:00
Yasuhiro Matsumoto 42a4d148c2 fix tests on tip 2017-08-02 01:26:57 +09:00
Ross Light 848386d7a2 Add connection option for recursive triggers
Similar to foreign keys, the recursive triggers PRAGMA affects the
interpretation of all statements on a connection.
2017-07-09 07:32:14 -07:00
Jason Abbott 59bd281a89 Incorporate original PR 271 from https://github.com/brokensandals 2017-07-03 12:51:48 -06:00
deepilla 05123859be Don't convert Unix times to nanoseconds when querying datetime fields. Fixes #430. 2017-06-30 13:17:04 -05:00
David Anderson 0430b37250 Add support for collation sequences implemented in Go.
This allows Go programs to register custom comparison functions with
sqlite, and ORDER BY that comparator.
2017-06-08 19:14:07 -07:00
Ross Light c6d43c40e6 Add _foreign_keys connection parameter
Fixes #377
Updates #255
2017-04-01 11:06:59 -07:00
Yasuhiro Matsumoto 5b1175ef06 not use underscore 2017-03-05 00:46:52 +09:00
Yasuhiro Matsumoto 7ed900a7c4 fix test 2017-01-19 02:20:42 +09:00
Yasuhiro Matsumoto 15491aeb9c go vet && golint 2016-11-06 13:16:38 +09:00