summaryrefslogtreecommitdiff
path: root/sqlite.zig (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* add BaseType support for structsGravatar Meghan Denny2021-09-231-0/+7
|
* add iteratorAlloc and execAllocGravatar Meghan Denny2021-09-231-2/+30
|
* add options parameter to bind/bindFieldGravatar Meghan Denny2021-09-231-9/+9
|
* more minor cleanupsGravatar Vincent Rischmann2021-09-071-10/+4
|
* Stop using anytype in the public API.Gravatar Vincent Rischmann2021-09-071-32/+52
| | | | | | | | | | | | | | | | | | | | | The need for using `options: anytype` in readXYZ functions is so that they can be used both when called by `one`/`next` or `oneAlloc`/`nextAlloc`. In the first case there won't be an allocator member in the tuple, in the latter there will be. But, since the public API takes an explicit allocator argument in `oneAlloc`/`nextAlloc` there's no need to take a `anytype` options in the public API. This commit changes the public API to always use `QueryOptions`. This commit also adds a bunch of explicit comptime checks to validate the options type passed to the readXYZ functions. Especially important is checking the presence of the `allocator` field if the function requires an allocator. Finally, cleanup some stuff and reorder arguments in `readPointer`.
* fix for ziglang/zig#9618Gravatar Vincent Rischmann2021-09-041-12/+15
|
* fix the compile error from readArrayGravatar Vincent Rischmann2021-08-311-2/+2
|
* implement reading a text column into an enum value directlyGravatar Vincent Rischmann2021-08-261-0/+39
| | | | | oneAlloc/nextAlloc can allocate memory so are allowed to use text backed enums.
* implement reading an integer column into an enum value directlyGravatar Vincent Rischmann2021-08-261-1/+60
| | | | one/next can't alloc so they are limited to integer values.
* fix documentationGravatar Vincent Rischmann2021-08-261-4/+2
|
* 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
|