summaryrefslogtreecommitdiff
path: root/sqlite.zig (unfollow)
Commit message (Collapse)AuthorFilesLines
2021-05-30set the eval branch quota in the return type blockGravatar Vincent Rischmann1-5/+10
`prepare` and `prepareWithDiags` parse the query at comptime in the return type definition. This exceeds the branch quota since https://github.com/ziglang/zig/commit/b11ac9c5bfb4048eb4aa561f8b3b058a76787f7e. Use a block and `@setEvalBranchQuota` to work around this. Fixes #30.
2021-05-09all: fix tests for latest zigGravatar Vincent Rischmann1-77/+77
2021-05-03attempt to make the threading mode error clearerGravatar Vincent Rischmann1-1/+1
2021-04-27workaround compiler bugGravatar Vincent Rischmann1-3/+9
This workaround allows one to write this: const Foobar = struct { foo: usize, bar: []const u8, }; const row = try stmt.one(Foobar); Where the first field in the struct (here `foo`) is either an integer type, a float type or a boolean. Moving the first field of this type to second position resolves the bug. This is because readInt, readFloat and readBool have an empty error set and cause this bug to trigger. Removing the error altogether also triggers the bug so we define an explicit error set. If we actually want to return an error from these functions we'll simply remove the workaround. See https://github.com/ziglang/zig/issues/5149
2021-04-23fix error nameGravatar Vincent Rischmann1-1/+1
2021-04-23Allow reading into static size arrays as long as size matchesGravatar daurnimator1-11/+12
2021-04-17improve logs in Statement.deinit and Statement.resetGravatar Vincent Rischmann1-3/+6
2021-04-17fix DetailedError and Diagnostics formattingGravatar Vincent Rischmann1-4/+8
2021-04-17replace the pragma argument with a nullable stringGravatar Vincent Rischmann1-18/+15
2021-04-17fix documentationGravatar Vincent Rischmann1-1/+1
2021-02-27simplify iterator usage in code and docGravatar Vincent Rischmann1-10/+5
2021-02-27add DiagnosticsGravatar Vincent Rischmann1-11/+130
2021-02-27store the database handle in Iterator and StatementGravatar Vincent Rischmann1-0/+4
2021-01-31add Blob.reopenGravatar Vincent Rischmann1-17/+53
2021-01-31add incremental i/o on blobGravatar Vincent Rischmann1-0/+204
2021-01-31add the Db.getLastInsertRowID methodGravatar Vincent Rischmann1-1/+24
2021-01-24rework of the test database initializationGravatar Vincent Rischmann1-45/+48
The hardcoded path we used is invalid on Windows, instead use a temp directory from std.testing.tmpDir. Need to do some refactoring too because now we compute the database file path and therefore need an allocator while the Mode is in use in Db.init.
2021-01-06allow binding and reading optionalsGravatar Vincent Rischmann1-2/+32
Also allow binding the '(null)' value.
2021-01-06add a test for optionalsGravatar Vincent Rischmann1-0/+27
2021-01-06fix compile error in readFieldGravatar Vincent Rischmann1-1/+1
2021-01-06add a test that reads only pointersGravatar Vincent Rischmann1-0/+35
2021-01-06implement reading a value into a one-element pointerGravatar Vincent Rischmann1-1/+6
2021-01-06add readFieldGravatar Vincent Rischmann1-15/+20
2021-01-06reorder fields to workaround a compiler bugGravatar Vincent Rischmann1-17/+17
2021-01-05logging file open {} -> {s}Gravatar Sebastian1-1/+1
2021-01-03convert {} to {s} or {d}Gravatar Vincent Rischmann1-3/+3
2021-01-02add a test for binding a .One pointerGravatar Vincent Rischmann1-0/+22
2021-01-02stop special casing []const u8 and []u8, do it in the .Pointer switch armGravatar Vincent Rischmann1-3/+6
2021-01-02allow binding a pointerGravatar Vincent Rischmann1-0/+1
2021-01-02add a test that binds a string literalGravatar Vincent Rischmann1-0/+20
2021-01-02add bindFieldGravatar Vincent Rischmann1-24/+31
2021-01-02fix the comment on Stmt.one and Stmt.allGravatar Vincent Rischmann1-3/+1
2021-01-01fix compile errorGravatar Vincent Rischmann1-1/+1
2021-01-01check the weight field tooGravatar Vincent Rischmann1-0/+1
2020-12-31fix tests with the new errorsGravatar Vincent Rischmann1-2/+2
2020-12-31add proper error typesGravatar Vincent Rischmann1-8/+7
* Add SQLiteError and various SQLiteExtendedXYZError * Replace old errors with the SQLite ones where appropriate Fixes #8
2020-12-30add pragmaAllocGravatar Vincent Rischmann1-21/+43
2020-12-30add more testsGravatar Vincent Rischmann1-28/+83
2020-12-30introduce *Alloc methodsGravatar Vincent Rischmann1-48/+109
Stmt.oneAlloc, Db.oneAlloc and Iterator.nextAlloc do the same thing as Stmt.one, Db.one, Iterator.next respectively but they can allocate memory. This is useful when reading TEXT or BLOB columns because if you can't allocate memory the only way to read these types is with an array which means you must have an idea of the maximum size of the column.
2020-12-30document OpenFlagsGravatar Vincent Rischmann1-0/+1
2020-12-30add more tests for failuresGravatar Vincent Rischmann1-0/+21
* one for Db.init * one for Db.prepare
2020-12-30remove loggingGravatar Vincent Rischmann1-3/+0
2020-12-30add Error, DetailedErrorGravatar Vincent Rischmann1-0/+33
2020-12-30document ThreadingMode and InitOptionsGravatar Vincent Rischmann1-1/+19
2020-12-30remove the allocator from Db and Db.initGravatar Vincent Rischmann1-21/+18
2020-12-29add initOptions for testingGravatar Vincent Rischmann1-14/+24
2020-12-29add InitOptionsGravatar Vincent Rischmann1-15/+29
2020-12-29add the threading modeGravatar Vincent Rischmann1-0/+14
2020-12-28rename is_ci to in_memoryGravatar Vincent Rischmann1-2/+2
2020-12-27fix some typosGravatar Vincent Rischmann1-2/+2