Eng Zer Jun
5141eff5fc
test: use T.TempDir to create temporary test directory
...
This commit replaces `ioutil.TempDir` with `t.TempDir` in tests. The
directory created by `t.TempDir` is automatically removed when the test
and all its subtests complete.
Prior to this commit, temporary directory created using `ioutil.TempDir`
needs to be removed manually by calling `os.RemoveAll`, which is omitted
in some tests. The error handling boilerplate e.g.
defer func() {
if err := os.RemoveAll(dir); err != nil {
t.Fatal(err)
}
}
is also tedious, but `t.TempDir` handles this for us nicely.
Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com >
2022-10-26 23:45:46 +08:00
Philip O'Toole
54aec1ca33
Tighten up backup code
2022-10-19 20:38:25 -04:00
Philip O'Toole
221907f8a9
Support nil as paramterized values
2022-10-13 15:51:27 -04:00
Philip O'Toole
c8b9fd72da
Sanity check supplied SQLite data
2022-05-09 22:07:36 -04:00
Philip O'Toole
c91ca45ba4
Expose more DB attributes
2022-05-09 17:46:58 -04:00
Philip O'Toole
a6a3567a4d
DB layer returns in-memory status
2022-05-09 15:33:40 -04:00
Philip O'Toole
d84fb85f01
Don't HTML escape JSON output
2022-03-01 09:16:13 -05:00
Philip O'Toole
869f3547b7
Update to SQLite 3.38
2022-02-28 22:30:36 -05:00
Philip O'Toole
ebb2ff32c2
Send rand() once in DB layer
2022-01-12 09:30:02 -05:00
Philip O'Toole
24a5dc8c4b
Much better random file names
2022-01-11 23:01:13 -05:00
chermehdi
3bfcbffc37
Fix typos and Grammar issues
2022-01-04 22:50:49 +00:00
Philip O'Toole
7038b86dcb
One final named params unit test
2021-12-31 16:21:13 -05:00
Philip O'Toole
01849e77d5
Add db-level support for named paremeters
2021-12-31 10:43:57 -05:00
Philip O'Toole
239cdc04b5
Don't run heavy memory tests in parallel
...
Let's see if this helps these tests run faster, especially with -race,
and prevent CircleCI timeouts.
2021-11-26 09:50:46 -05:00
Philip O'Toole
eab9183acd
Better comment in DB code
2021-11-16 09:05:27 -05:00
Philip O'Toole
51bb54488b
Explicitly handle column type nil (null)
2021-10-22 17:04:57 -04:00
Philip O'Toole
c639f21cde
Return time types in RFC3339 format
2021-10-22 16:03:39 -04:00
Philip O'Toole
28063bfa0d
Support timestamp field
2021-10-22 15:51:59 -04:00
Philip O'Toole
53e4b9ae3d
ABL
2021-10-18 19:08:35 -04:00
Philip O'Toole
437d76bc1c
Update db.go
2021-10-18 19:01:34 -04:00
Philip O'Toole
bed9dc2a49
Update db_test.go
2021-10-18 19:01:01 -04:00
Philip O'Toole
393a1c67a0
Fix unit tests
2021-10-18 12:42:00 -04:00
Philip O'Toole
3ed0909746
Read-only statements in query endpoint
2021-10-18 12:36:30 -04:00
Philip O'Toole
519a91e635
Actual recovery node test passes on Linux
2021-09-20 19:24:04 -04:00
Philip O'Toole
2bf7638a8d
Fix debug code in test
2021-09-08 09:03:10 -04:00
Philip O'Toole
01895e501f
Serialize on-disk databases by simply reading file
...
This is safe according to https://sqlite.org/howtocorrupt.html and
avoids any sqlite3_serialize() limitations.
2021-09-08 09:01:44 -04:00
Philip O'Toole
c0b22b0d03
Update CHANGELOG
2021-09-01 09:53:36 -04:00
Philip O'Toole
08eb74493d
Add unit test for >1GiB in-memory databases
...
>2GiB in-memory are still not supported.
2021-09-01 09:50:51 -04:00
Philip O'Toole
44e47686ee
Tests that demonstrate current isolation behavior
2021-08-25 08:57:10 -04:00
Philip O'Toole
a4c4374daf
Update CHANGELOG
2021-08-18 16:18:22 -04:00
Philip O'Toole
3907132761
Add detailed SQLite memstats to status/
2021-08-18 16:16:10 -04:00
Philip O'Toole
aa8df67592
DB-level unit tests pass
2021-08-14 10:14:23 -04:00
Philip O'Toole
161abb094d
Add db-level FK constraints unit test
2021-08-11 21:19:10 -04:00
Philip O'Toole
deb4dabf2e
Thread through foreign key constraint controls
2021-08-11 12:11:22 -04:00
Philip O'Toole
2cad491f40
Better creation of SQLite DSNs
2021-08-11 11:51:12 -04:00
Philip O'Toole
f7b390ab28
Adding JSON1 unit test
2021-08-07 10:07:24 -04:00
Philip O'Toole
96f9e85ee3
More concurrent query testing
2021-08-07 09:44:05 -04:00
Philip O'Toole
3cee11de6f
Count number of query errors
2021-08-06 23:14:10 -04:00
Philip O'Toole
6c69e8a9b5
Upgrade to new compile options
2021-08-05 20:35:14 -04:00
Philip O'Toole
ea723ee830
Ping databases on open to ensure full availability
2021-08-05 10:55:29 -04:00
Philip O'Toole
953e82f7c4
Add SQLite compile-time options to status output
2021-08-05 10:10:14 -04:00
Philip O'Toole
11da97f455
Fix typo
2021-08-05 08:17:20 -04:00
Philip O'Toole
497d3dd873
Remove obsolete foreign key constraint control
2021-08-04 23:13:33 -04:00
Philip O'Toole
c086eba427
Remove debug statement
2021-08-04 23:11:53 -04:00
Philip O'Toole
b83424484d
Enhance SQLite database status
2021-08-04 23:10:22 -04:00
Philip O'Toole
cc8b924e64
Fix WaitGroup usage in test
2021-08-04 22:43:35 -04:00
Philip O'Toole
4f2818d037
Add concurrent query test
2021-08-04 22:31:20 -04:00
Philip O'Toole
eec7494d62
DB size requires a read-write connection
2021-08-04 12:27:51 -04:00
Philip O'Toole
6edff5ba24
Deal with SQLite connection "caching"?
...
https://github.com/mattn/go-sqlite3/issues/966
2021-08-04 11:43:45 -04:00
Philip O'Toole
bf51947ca9
Better error messages
2021-08-03 15:04:29 -04:00