0
0
mirror of https://gitlab.com/cznic/sqlite.git synced 2025-05-22 23:28:02 +00:00

67 Commits

Author SHA1 Message Date
c128158b86 remove user-facing global state 2022-07-23 12:46:41 +02:00
8be0ef8f37 switch from embed.FS to fs.FS 2022-07-23 11:24:08 +02:00
85dd432315 implement embed support prototype 2022-07-22 14:45:40 +02:00
f2a990b23b Fix handling of nil []byte as NULL values
This fixes a regression introduced in 87412bbfa9,
which changed nil []byte values by storing them as zero-sized blobs, instead of
NULLs.

Closes 
2022-05-18 23:52:19 +03:00
f2c77c5fed upgrade to SQLite 3.38.3 2022-05-02 16:41:55 +02:00
07ddc240d9 document v1.16 release 2022-04-04 14:52:56 +02:00
a922751947 driver: add a way to register scalar functions 2022-04-03 15:57:52 +02:00
87412bbfa9 driver: fix inserting empty blobs 2022-04-03 10:09:39 +00:00
f5a64f2267 sqlite: initial handling for user defined functions
This PR adds handling for user defined functions. Initially only the
xFunc parameter will be set, the others will come in subsequent PRs.
A test for a 'regexp' udf was added to check that the query

  "SELECT 'seafood' REGEXP 'foo.*'"

works as expected.
2022-04-01 13:59:51 +00:00
302d71cedc Fix race condition if exec's context is canceled just after completion 2022-03-15 11:22:26 +00:00
8e27ffc817 Add _txlock DSN parameter to customize BEGIN 2022-02-03 14:14:24 +00:00
7b21af2c7f darwin/arm64: regenerate, update dependencies 2021-12-10 15:32:31 +01:00
12794c24e9 3.37.0: regenerate all but darwin/arm64, netbsd/amd64 and windows/386 2021-11-29 14:57:11 +01:00
5e04542b70 darwin/amd64: regenerate with updated dependencies, updates libc#13 2021-11-10 15:41:27 +01:00
064df839a4 driver: support _time_format DSN query param
Building on the _pragma query param support added in 508747c9, support
a new _time_format query param.

If _time_format is set to "sqlite", written times use the time package
format "2006-01-02 15:04:05.999999999-07:00". This is the format
mattn/go-sqlite3 uses and is format 4 at
https://sqlite.org/lang_datefunc.html#time_values.

By default, times are formatted with time.Time.String. This maintains
compatibility with existing users of the driver.

Fixes 
2021-10-23 15:36:02 -03:00
a530c91309 driver: return error strings for constraint errors
In conn.step, use conn.errstr which gets the error from sqlite instead
of looking up the result code in the ErrorCodeString map.

This changes the code 5 (SQLITE_BUSY) message slightly, including
"database is locked" as returned my errstr. "SQLITE_BUSY" is still
added to the message.

Fixes 
2021-10-23 09:42:14 -03:00
e3be4b029c fix retry logic around conn.step, updates 2021-09-14 16:20:20 +02:00
aa7d275125 windows: fix TestPersistPragma.2, updates 2021-09-01 14:24:15 +02:00
0c9a6edac0 Merge branch 'persistent_pragma_configs' into 'master'
Persist pragma configurations via url parameter

Closes 

See merge request 
2021-08-19 00:02:34 +00:00
508747c957 Persist pragma configurations via url parameter 2021-08-19 00:02:34 +00:00
3ef4b5e692 restart builders 2021-08-18 18:39:17 +02:00
80c708f2aa fix race on conn.{Close,interrupt}, updates 2021-07-22 12:47:08 +02:00
7de07c7a26 fix manual memory management error, updates 2021-05-06 12:04:30 +02:00
5a2af3f4dc Set up mutex on lib package initialization
Fixes 
2021-04-21 20:56:35 -07:00
4800b08a35 update dependencies 2021-04-08 12:18:25 +02:00
e2b915c98c driver: set libc environment in init
modernc.org/libc.Start does this when wrapping funcs main to seed data
for libc.Xgetenv and friends.

However, sqlite doesn't use libc.Start. It sets libc bits up in an
init func. This leaves the libc view of the enivorment empty/null.

When the sqlite "localtime" modifier used with datetime/strftime/etc,
sqlite eventually calls libc.Xlocaltime which wants to read TZ from
the environment. With an empty/null libc enivornment, this segfaults.

To fix that, call libc.SetEnviron in func init like libc.Start
does.

Fixes https://gitlab.com/cznic/sqlite/-/issues/49
2021-04-05 20:35:19 -03:00
fae63b194d linux/amd64: enable pthreads 2021-03-23 00:17:08 +01:00
798bbeb9bb driver: support scanning more formats into time.Time
Fixes https://gitlab.com/cznic/sqlite/-/issues/46
2021-03-14 16:07:07 -03:00
77ccaf71ff driver: return column info even when no rows
Fixes https://gitlab.com/cznic/sqlite/-/issues/32
2021-03-14 13:09:25 -03:00
f5bcea6543 split production and testing 2021-01-30 01:09:04 +01:00
3c751e6fc6 fix memory leak caused by returning noRows{}/II, updates 2021-01-25 13:30:37 +01:00
168943b08a fix memory leak caused by returning noRows{}, updates 2021-01-25 12:22:10 +01:00
2d062fa148 driver: support ?NNN and $NNN parameters, add tests
Fix a bug around ensuring each index matches a corresponding
argument.

Support ?NNN parameters by checking for a match between NNN and
Ordinal. Do the same for $NNN even though $NNN should technically
require sql.Named.

Updates https://gitlab.com/cznic/sqlite/-/issues/42.
2021-01-18 11:23:00 -04:00
0a7471a043 Makefile: add regression_check target 2021-01-17 21:34:54 +01:00
295d48b2e8 Merge branch 'un-goroutine-ctx' into 'master'
un-go-routine the ctx cancelations

See merge request 
2021-01-12 20:39:48 +00:00
bfc1503df5 un-go-routine the ctx cancelations 2021-01-12 20:39:48 +00:00
56d82b45dc noRows: return proper io.EOF 2021-01-12 18:19:04 +01:00
d12d3a4d8c handle binding zero length blobs, updates 2021-01-12 17:50:29 +01:00
663f19b57d handle zero sized allocs 2021-01-12 17:40:04 +01:00
9383707da0 conn.Close: fix memory leak 2021-01-11 13:21:44 +01:00
90dac3ac7b rows.Next: support scanning of time values, fixes 2021-01-10 15:26:54 +01:00
b69b933c94 Add support for NULL values 2020-10-12 22:09:42 +03:00
736c530ac7 implement sql.{RowsColumnTypeScanType,RowsColumnTypeDatabaseTypeName,RowsColumnTypeLength,RowsColumnTypeNullable,RowsColumnTypePrecisionScale}, fixes 2020-09-25 15:12:39 +02:00
a4318db8c7 handle properly 0 rows query results, fixes 2020-09-21 18:36:03 +02:00
e662a135d1 release 1.4.0 2020-08-26 23:31:54 +02:00
43c865ce5d regenerate and update dependencies 2020-08-04 17:15:32 +02:00
1349149922 use crt v3.24.9 2020-07-31 14:18:38 +02:00
3337c85b5e 103 errors out of 202628 tests on Linux 64-bit little-endian 2020-07-30 17:13:42 +02:00
b406626c64 release v1.4.0-beta1 2020-07-26 22:36:18 +02:00
141c3f22b7 fix forgotten TODO 2020-01-01 12:05:39 +01:00