summaryrefslogtreecommitdiff
path: root/sqlite.zig (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* sqlite: interpret database path in init flags as uriGravatar Kenta Iwasaki2021-08-271-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, });
* sqlite: expose c import, add 'shared_cache' to init flagsGravatar Kenta Iwasaki2021-08-261-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.
* dry up the updated constraint checkGravatar Meghan Denny2021-08-241-14/+11
|
* fix type constraint checks for container and non-container typesGravatar Meghan Denny2021-08-241-2/+18
|
* enum tests now pass without orelse in readGravatar Meghan Denny2021-08-241-1/+1
|
* fix bind indexGravatar Meghan Denny2021-08-241-2/+2
|
* tests- add enum field casesGravatar Meghan Denny2021-08-231-12/+31
|
* tests- use select * when pulling into a structGravatar Meghan Denny2021-08-231-2/+2
|
* add support for enum fields and lay groundwork for #39Gravatar Meghan Denny2021-08-231-1/+21
|
* Merge pull request #36 from nektro/masterGravatar Vincent Rischmann2021-08-121-11/+10
|\ | | | | Various fixes
| * update tests for new use of `Db.init`Gravatar Meghan Denny2021-08-111-6/+2
| |
| * adding allocator to Db.QueryOptions was a mistakeGravatar Meghan Denny2021-08-111-1/+0
| |
| * clarify bind marker len compile errorGravatar Meghan Denny2021-08-091-1/+4
| |
| * options asks for `allocator` field but its not thereGravatar Meghan Denny2021-08-091-0/+1
| |
| * iterator- pass along options objectGravatar Meghan Denny2021-08-091-1/+1
| |
| * make `init` return a Self instead of updating a pointerGravatar Meghan Denny2021-08-091-3/+3
| |
* | move the documentation to Db.openBlob since that is the method user will callGravatar Vincent Rischmann2021-08-091-19/+26
| |
* | clarify Blob.openGravatar Vincent Rischmann2021-08-091-0/+1
| |
* | document the ZeroBlob typeGravatar Vincent Rischmann2021-08-091-0/+17
| |
* | clarify the OpenFlagsGravatar Vincent Rischmann2021-08-091-0/+5
| |
* | clarify Mode documentationGravatar Vincent Rischmann2021-08-091-0/+4
|/
* modify exec to take a QueryOptionsGravatar Vincent Rischmann2021-08-021-21/+47
| | | | Fixes #35
* fix 'unused variable' errorsGravatar Vincent Rischmann2021-06-251-6/+1
|
* fix 'redundant comptile' errorGravatar Vincent Rischmann2021-06-251-2/+2
|
* fix 'unused function parameter' errorGravatar Vincent Rischmann2021-06-251-0/+5
|
* set the eval branch quota in the return type blockGravatar Vincent Rischmann2021-05-301-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.
* all: fix tests for latest zigGravatar Vincent Rischmann2021-05-091-77/+77
|
* attempt to make the threading mode error clearerGravatar Vincent Rischmann2021-05-031-1/+1
|
* workaround compiler bugGravatar Vincent Rischmann2021-04-271-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
* fix error nameGravatar Vincent Rischmann2021-04-231-1/+1
|
* Allow reading into static size arrays as long as size matchesGravatar daurnimator2021-04-231-11/+12
|
* improve logs in Statement.deinit and Statement.resetGravatar Vincent Rischmann2021-04-171-3/+6
|
* fix DetailedError and Diagnostics formattingGravatar Vincent Rischmann2021-04-171-4/+8
|
* replace the pragma argument with a nullable stringGravatar Vincent Rischmann2021-04-171-18/+15
|
* fix documentationGravatar Vincent Rischmann2021-04-171-1/+1
|
* simplify iterator usage in code and docGravatar Vincent Rischmann2021-02-271-10/+5
|
* add DiagnosticsGravatar Vincent Rischmann2021-02-271-11/+130
|
* store the database handle in Iterator and StatementGravatar Vincent Rischmann2021-02-271-0/+4
|
* add Blob.reopenGravatar Vincent Rischmann2021-01-311-17/+53
|
* add incremental i/o on blobGravatar Vincent Rischmann2021-01-311-0/+204
|
* add the Db.getLastInsertRowID methodGravatar Vincent Rischmann2021-01-311-1/+24
|
* rework of the test database initializationGravatar Vincent Rischmann2021-01-241-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.
* allow binding and reading optionalsGravatar Vincent Rischmann2021-01-061-2/+32
| | | | Also allow binding the '(null)' value.
* add a test for optionalsGravatar Vincent Rischmann2021-01-061-0/+27
|
* fix compile error in readFieldGravatar Vincent Rischmann2021-01-061-1/+1
|
* add a test that reads only pointersGravatar Vincent Rischmann2021-01-061-0/+35
|
* implement reading a value into a one-element pointerGravatar Vincent Rischmann2021-01-061-1/+6
|
* add readFieldGravatar Vincent Rischmann2021-01-061-15/+20
|
* reorder fields to workaround a compiler bugGravatar Vincent Rischmann2021-01-061-17/+17
|
* logging file open {} -> {s}Gravatar Sebastian2021-01-051-1/+1
|