aboutsummaryrefslogtreecommitdiff
path: root/sqlite3.go (follow)
Commit message (Expand)AuthorAgeFilesLines
* sqlite3.go: Remove -DSQLITE_ENABLE_FTS4_UNICODE61: not supported (#872)•••This option was enabled by default in sqlite3 on 2014-07-03. This setting does nothing. It can now be disabled with SQLITE_DISABLE_FTS3_UNICODE. See the upstream commit: https://sqlite.org/src/info/0cc0230ae9cfc976 I think this change was imported into this project with commit ee9da4840dd680d1fe2927692ea4ab5f8cd7c91c on 2015-06-12.Evan Jones2020-11-171-1/+0
* sqlite3.go: remove -DSQLITE_DISABLE_INTRINSIC: better builds (#878)•••This "disables the use of compiler-specific built-in functions such as __builtin_bswap32()" (from the SQLite docs) so this change might produce slightly better code. My primary motivation, however, is that the "default" configuration for SQLite, which is widely tested, does not set this preprocessor macro. From looking at Github issues, it appears this was added to avoid a build error on Mac OS X 10.11, in 2017: https://github.com/mattn/go-sqlite3/issues/386 There have been a number of changes to sqlite3 since we tried this last. I think it would be worth trying to remove this setting again. I found a machine running Mac OS X 10.11.6. It was able to build and run the tests in this package with this change. Mac OS X 10.11 is has not been supported by Apple since 2018 (currently Apple is releasing updates for Mac OS 10.13 and newer; 11 is the current release). However, Go 1.14 is supported, and it requires Mac OS X 10.11 or newer: https://golang.org/doc/go1.14 Go 1.15 only supports Mac OS 10.12 and newer: https://golang.org/doc/go1.15Evan Jones2020-11-171-1/+0
* Support vfs for Open (#877)•••Closes #876mattn2020-11-171-1/+11
* Fix "cannot start a transaction within a transaction" issue (#764) (#765)•••* Fix "cannot start a transaction within a transaction" issue [why] If db.BeginTx(ctx, nil) context is cancelled too fast, "BEGIN" statement can be completed inside DB, but we still try to cancel it with sqlite3_interrupt. In such case we get context.Cancelled or context.DeadlineExceeded from exec(), but operation really completed. Connection returned into pool, and returns "cannot start a transaction within a transaction" error for next db.BeginTx() call. [how] Handle status code returned from cancelled operation. [testing] Added unit-test which reproduces issue. * Reduce TestQueryRowContextCancelParallel concurrency [why] Tests times out in travis-ci when run with -race option.Andrii Zavorotnii2020-08-291-5/+16
* Use go-pointer instead of uintptr hacks. (#814)•••* Use go-pointer instead of uintptr hacks. Fixes #791 * Do same of go-pointer * Drop older verion of Go * Fix build * Fix buildmattn2020-08-261-10/+10
* Enable all prefixes for named parameters and allow for unused named parameter...•••* 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>gber2020-05-141-53/+77
* fix typo in doc comment (#770)rittneje2019-12-171-3/+3
* 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 rittneje2019-12-171-8/+27
* Merge pull request #744 from azavorotnii/ctx_cancel•••Fix context cancellation racy handlingmattn2019-11-191-37/+59
|\
| * Fix context cancellation racy handling•••[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. Andrii Zavorotnii2019-09-061-37/+59
* | Add build constraints for non cgoYasuhiro Matsumoto2019-11-181-1/+1
* | Fix typo in "_locking_mode" DSN handlingAndrii Zavorotnii2019-09-231-1/+1
* | Fix Open() journal mode regression•••[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. Andrii Zavorotnii2019-09-231-5/+6
|/
* Fixed operatorG.J.R. Timmer2019-08-221-2/+2
* Fix _auth_* parameter check•••Fixes: #724G.J.R. Timmer2019-08-221-2/+2
* Issue #651: Fix of typo•••https://github.com/mattn/go-sqlite3/issues/651 =2019-08-191-1/+1
* Fix type of variadicYasuhiro Matsumoto2019-05-101-1/+1
* column_type SQLITE_TEXT returned as string by defaultDimitri Roche2019-02-111-8/+1
* column types text, varchar, *char return as strings:•••As opposed to []byte arrays. This brings sqlite closer in line with other dbs like postgres, allowing downstream consumers to assume the scanned value is string across underlying dbs. Dimitri Roche2019-02-111-2/+8
* Revert "SQLITE_OPEN_CREATE should be specified for sqlite3_open_v2 if mode is...•••This reverts commit 03b96a53baf1987fe52b653ce0d1817e549259b8. Jesse Rittner2018-12-081-16/+6
* SQLITE_OPEN_CREATE should be specified for sqlite3_open_v2 if mode is not rw•••Fixes #667 Fixes #669 Yasuhiro Matsumoto2018-12-071-6/+16
* Close db even if sqlite3_open_v2 return non-zero.Yasuhiro Matsumoto2018-12-071-0/+3
* Merge pull request #626 from otoolep/fix_data_race•••Fix data race in AutoCommit()mattn2018-11-221-0/+2
|\
| * Fix data race in AutoCommit()•••Detected via https://circleci.com/gh/rqlite/rqlite/2223. Philip O'Toole2018-08-301-0/+2
* | Merge pull request #643 from akalin/zero-length-blob•••Distinguish between NULL and zero-length blobs on querymattn2018-11-221-1/+1
|\ \
| * | Fix bugFrederick Akalin2018-09-221-1/+1
* | | Merge pull request #644 from akalin/fix-pointer-conversion•••Clean up blob to byte slice conversionmattn2018-11-221-7/+2
|\ \ \
| * | | Use GoBytesFrederick Akalin2018-09-221-7/+2
| |/ /
* | | Fix misspell issues.•••See, $ gometalinter --vendor --disable-all --enable=misspell ./... sqlite3.go:1379:45:warning: "succesfully" is a misspelling of "successfully" (misspell) sqlite3.go:1390:30:warning: "registerd" is a misspelling of "registered" (misspell) sqlite3_func_crypt.go:16:27:warning: "ceasar" is a misspelling of "caesar" (misspell) sqlite3_func_crypt.go:43:59:warning: "Ceasar" is a misspelling of "Caesar" (misspell) sqlite3_opt_userauth_test.go:450:27:warning: "succesful" is a misspelling of "successful" (misspell) sqlite3_opt_userauth_test.go:456:27:warning: "succesful" is a misspelling of "successful" (misspell) Mario Trangoni2018-11-211-2/+2
* | | all: fix cgo compile failures on tip•••Apparently the cgo typechecks get better on tip, so use C.int instead of Go integers. Build tip as part of the Travis build, so we can ensure that any errors are resolved before they get released to a wider audience. Kevin Burke2018-11-011-2/+2
* | | Rename the wrapper functions to not pollute the sqlite3_* namespaceMura Li2018-10-201-15/+15
* | | Add support for sqlite3_unlock_notifyMura Li2018-10-201-4/+41
|/ /
* | Fix build•••Related on #623 Yasuhiro Matsumoto2018-09-111-1/+1
* | Merge pull request #623 from graf0/feature/#619•••implementation of set_authorizer interfacemattn2018-09-111-0/+55
|\ \ | |/ |/|
| * clearer const formatting•••with comments what const are used for what Grzegorz Marszałek2018-08-301-8/+13
| * implementation of set_authorizer interfaceGrzegorz Marszałek2018-08-251-3/+53
* | Update go doc comments to refer to correct interfaces.•••sql.Driver, sql.Conn, sql.Tx sql.Stmt, and sql.Rows are not interfaces. Updated the comments to refer to the correct interfaces: driver.Driver, driver.Conn, driver.Tx, driver.Stmt, and driver.Rows. AndrewMurrell2018-08-211-6/+6
|/
* Ensure that SqliteStmt.closed property is guarded.•••Because the closed property of the SQLiteRows's *SqliteStmt was not guarded, it was causing an issue during context cancellation. https://github.com/segmentio/go-sqlite3/blob/be424d27acde822f080bdcd8a7ae6abd4d7d801e/sqlite3.go#L1785-L1796 When a statement is performing a query(), if it determines that the context has been canceled, it will launch a goroutine that closes the resulting driver.Rows if it's not already completed. If the driver.Rows is not done (and the context has been canceled), it will interrupt the connection and more importantly, perform a rows.Close(). The method rows.Close() guards the closed bool with a sync.Mutex to set it to true. If a reader is reading from the SqliteRow, it will call Next() and that performs this check: https://github.com/segmentio/go-sqlite3/blob/be424d27acde822f080bdcd8a7ae6abd4d7d801e/sqlite3.go#L1915-L1917 Because this is not guarded, a data race ensues, and this was actually caught by the Go race detector recently. I didn't include a test case here because the fix seemed straightforward enough and because race conditions are hard to test for. It's been verified in another program that this fixes the issue. If tests should be provided I'm more than happy to do so. Collin Van Dyck2018-07-191-2/+2
* fix/118•••* Added TestMultiBlobs * Removed dead code Fixes #118Gert-Jan Timmer2018-06-121-2/+0
* Adds GetFilename (sqlite3_db_filename) to SqliteConnZachary Gramana2018-06-121-0/+11
* Merge pull request #586 from mattn/feature/userauth•••Feature/userauthmattn2018-06-081-2/+185
|\
| * ADD: User Authentication Password Encoders•••Allow user to choose how to encode passwords with connection string overrides of embedded `sqlite_crypt` function.Gert-Jan Timmer2018-06-051-0/+58
| * Implemented goconvey for User Authentication Tests•••Reference #580Gert-Jan Timmer2018-06-041-5/+5
| * Update User Authentication•••* Update bindings * Add user authentication sql functions Reference #579Gert-Jan Timmer2018-06-011-12/+18
| * Stash•••[ci skip]Gert-Jan Timmer2018-05-311-4/+4
| * UPD: User Authentication•••Implemented table check; only activate User Authentication on a database which has no UA enabled. Closes #582Gert-Jan Timmer2018-05-311-8/+2
| * ADD: User authentication•••* User Authentication Implementation * Rename file to conform to fileformat `sqlite3_*_omit.go` * Updated sqlite3-binding.* with new upgrade tool * Add: callbackRetNil required for error type return because of adding `RegisterFunc`s directly on the connection. * Add: TestCreateAuthDatabase Gert-Jan Timmer2018-05-301-2/+127
* | Add nil check in bind and a testLucas Manuel Rodriguez2018-05-301-4/+8
|/
* Fix: Display of secure_delete error messageGert-Jan Timmer2018-05-291-1/+1
* Fix: Condition of queryOnly VariableGert-Jan Timmer2018-05-291-1/+1