summaryrefslogtreecommitdiff
path: root/sqlite.zig (unfollow)
Commit message (Collapse)AuthorFilesLines
2021-08-26implement reading an integer column into an enum value directlyGravatar Vincent Rischmann1-1/+60
one/next can't alloc so they are limited to integer values.
2021-08-26fix documentationGravatar Vincent Rischmann1-4/+2
2021-08-27sqlite: interpret database path in init flags as uriGravatar Kenta Iwasaki1-1/+1
To avoid the need for introducing multiple sqlite.Mode's for addressing all the different possible ways one may initialize a SQLite database, enable the flag SQLITE_OPEN_URI by default. This allows for initialization options which are not addressed by InitFlags as of yet, such as the option to initialize a shared in-memory SQLite database instance that may be shared across connections in the same address space, to be set via. URI query parameters. e.g. sqlite.Db.init({ .mode = .{ .File = "file:hello.db?mode=memory&cache=shared" }, .open_flags = .{ .create = true, .write = true }, .threading_mode = .MultiThread, });
2021-08-26sqlite: expose c import, add 'shared_cache' to init flagsGravatar Kenta Iwasaki1-1/+10
Expose the C import to sqlite.h. Making a separate call to @cImport outside of the library will cause Zig to regenerate all definitions in sqlite.h. The regenerated definitions (i.e. structs, enums) would not be equivalent to the definitions imported in by this library. This causes problems in the case one wants to manually wrap SQLite structs, pointers, and enums with the helpers provided in this library. Added 'shared_cache' to init flags in order to allow having the same backing table and statement cache shared amongst all connections pointed to the same database file.
2021-08-24dry up the updated constraint checkGravatar Meghan Denny1-14/+11
2021-08-24fix type constraint checks for container and non-container typesGravatar Meghan Denny1-2/+18
2021-08-24enum tests now pass without orelse in readGravatar Meghan Denny1-1/+1
2021-08-24fix bind indexGravatar Meghan Denny1-2/+2
2021-08-23tests- add enum field casesGravatar Meghan Denny1-12/+31
2021-08-23tests- use select * when pulling into a structGravatar Meghan Denny1-2/+2
2021-08-23add support for enum fields and lay groundwork for #39Gravatar Meghan Denny1-1/+21
2021-08-11update tests for new use of `Db.init`Gravatar Meghan Denny1-6/+2
2021-08-11adding allocator to Db.QueryOptions was a mistakeGravatar Meghan Denny1-1/+0
2021-08-09move the documentation to Db.openBlob since that is the method user will callGravatar Vincent Rischmann1-19/+26
2021-08-09clarify Blob.openGravatar Vincent Rischmann1-0/+1
2021-08-09document the ZeroBlob typeGravatar Vincent Rischmann1-0/+17
2021-08-09clarify the OpenFlagsGravatar Vincent Rischmann1-0/+5
2021-08-09clarify Mode documentationGravatar Vincent Rischmann1-0/+4
2021-08-09clarify bind marker len compile errorGravatar Meghan Denny1-1/+4
2021-08-09options asks for `allocator` field but its not thereGravatar Meghan Denny1-0/+1
2021-08-09iterator- pass along options objectGravatar Meghan Denny1-1/+1
2021-08-09make `init` return a Self instead of updating a pointerGravatar Meghan Denny1-3/+3
2021-08-02modify exec to take a QueryOptionsGravatar Vincent Rischmann1-21/+47
Fixes #35
2021-06-25fix 'unused variable' errorsGravatar Vincent Rischmann1-6/+1
2021-06-25fix 'redundant comptile' errorGravatar Vincent Rischmann1-2/+2
2021-06-25fix 'unused function parameter' errorGravatar Vincent Rischmann1-0/+5
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