summaryrefslogtreecommitdiff
path: root/sqlite.zig (follow)
Commit message (Collapse)AuthorAgeFilesLines
* update to Zig 0.11Gravatar Meghan Denny2023-08-171-1/+1
| | | | workaround for https://github.com/ziglang/zig/issues/16663
* DynamicStatement.all: use iteratorAllocGravatar Meghan2023-07-101-1/+1
| | | Statement.all already does
* test: add default value for TestUser.ColorGravatar Meghan2023-07-071-0/+1
|
* readField remove unreachable and support default value in string backed enumsGravatar Meghan2023-07-071-2/+1
|
* cast builtins removed typeGravatar Meghan2023-07-061-2/+2
|
* support packed structs as columns backed by their int typeGravatar Meghan2023-07-061-2/+7
|
* update for latest zigGravatar Vincent Rischmann2023-07-021-50/+45
|
* update for latest zigGravatar Vincent Rischmann2023-06-211-6/+6
|
* replace std.math.max with @maxGravatar Vincent Rischmann2023-06-181-1/+1
|
* replace meta.tagName with @tagNameGravatar Vincent Rischmann2023-05-171-4/+4
|
* Fix build failures on latest ZigGravatar Lue2023-05-171-2/+2
| | | | | | | Now the correct build APIs and `@memset` builtin are used. Unfortunately cImport fails for `aarch64` and `riscv64` targets, but I'm not sure how to fix this.
* fix calls to sqlite3_bind_text in bindFieldGravatar Vincent Rischmann2023-03-111-2/+4
|
* fix for latest zig by running 'zig fmt'Gravatar Vincent Rischmann2023-02-221-12/+12
|
* fix testsGravatar Vincent Rischmann2023-02-161-1/+1
|
* fix for latest zigGravatar Vincent Rischmann2022-12-261-15/+15
|
* stop using removed ascii functionsGravatar Vincent Rischmann2022-12-261-2/+2
|
* Update for latest Zig builtin renamesGravatar Ryan Liptak2022-12-191-7/+7
| | | | See https://github.com/ziglang/zig/pull/13930
* fix redundant comptimeGravatar Vincent Rischmann2022-12-091-1/+1
|
* fix for latest zigGravatar Vincent Rischmann2022-12-011-2/+2
|
* Fix compile error with Zig 0.10.0Gravatar Ryan Liptak2022-11-011-1/+1
| | | | | | | | | | Fixes the following error: ``` sqlite.zig:343:50: error: expected type '[*c]const u8', found '[:0]const u8' const result = c.sqlite3_open_v2(path, &db, flags, null); ^~~~ ```
* drop comptime from execMulti queryGravatar Luna2022-09-291-1/+1
| | | | not needed as we always prepare a dynamic statement
* add the virtual table implementationGravatar Vincent Rischmann2022-09-181-0/+25
|
* move test helpersGravatar Vincent Rischmann2022-09-181-44/+1
|
* move setFunctionArgument to helpers.setTypeFromValueGravatar Vincent Rischmann2022-09-181-50/+2
| | | | Will be used in the virtual table implementation
* move setFunctionResult to helpers.setResultGravatar Vincent Rischmann2022-09-181-37/+4
| | | | This function will also be used by the virtual table implementation.
* remove pointless discardGravatar Vincent Rischmann2022-09-131-1/+0
|
* drop the table in the testsGravatar Vincent Rischmann2022-08-311-4/+16
| | | | Necessary for running the tests with eg `-Din_memory=false -Ddbfile=/tmp/my.db`
* make `c` public againGravatar Vincent Rischmann2022-08-151-1/+1
| | | | Accidentally made it private during a refactoring
* require SQLite >= 3.21.0Gravatar Vincent Rischmann2022-08-141-5/+1
| | | | | | | | | | | | After some testing it turns out we need at least SQLite 3.21.0 to compile. We _could_ work around this and make zig-sqlite work with older SQLite versions but I don't think it's necessary because: * "old" distributions like Debian Buster, RHEL 8 ship with SQLite > 3.21.0 * in any case if people want to build for OSes where SQLite is too old they can use the bundled source code.
* move versionGreaterThanOrEqualTo in sqlite.zigGravatar Vincent Rischmann2022-08-051-0/+5
| | | | We will need it later on.
* move Text in sqlite.zigGravatar Vincent Rischmann2022-08-051-1/+3
| | | | | | | | | At first Blob and Text were defined in query.zig because they were used for bind parameters, but now we also use them for reading text or blob columns appropriately. Both types now live in sqlite.zig which query.zig already imports so it doesn't change anything.
* move DetailedError, do some cleanupGravatar Vincent Rischmann2022-08-041-43/+3
| | | | | | | | DetailedError uses getLastErrorOffset, which must check the SQLite version with versionGreaterThanOrEqualTo. Instead of publicly exposing versionGreaterThanOrEqualTo in sqlite.zig move DetailedError in errors.zig
* use a single cImportGravatar Vincent Rischmann2022-08-041-3/+1
| | | | | | | | | Two cImport calls generate incompatible code: we can't use the structs generated in sqlite.zig in functions in errors.zig for example Up until now it wasn't actually a problem since in errors.zig we only ever used constants which does work, but now we want to introduce functions in this file.
* no need for 'comptime' for this checkGravatar Vincent Rischmann2022-08-021-1/+1
| | | | A comparison against a const is already comptime.
* create a specific CreateFunctionFlag struct based on the SQLite versionGravatar Vincent Rischmann2022-08-021-2/+16
|
* add a way to get the aggregate context with createAggregateFunctionGravatar Vincent Rischmann2022-07-141-53/+161
| | | | | | | | | | | | | | | | | | | | The old way of working was that we always passed the user context as first argument to both `step` and `finalize` functions and the caller had no way of getting the aggregate context from SQLite (http://www3.sqlite.org/c3ref/aggregate_context.html). Now both `step` and `finalize` functions must have a first argument of type `FunctionContext`: fn step(fctx: FunctionContext, input: u32) void { var ctx = fctx.aggregateContext(*u32) orelse return; ctx.* += input; } fn finalize(ctx: *u32) u32 { var ctx = fctx.aggregateContext(*u32) orelse return 0; return ctx.sum; } Fixes #89
* clarify the compile errorGravatar Vincent Rischmann2022-05-241-1/+1
|
* Make ParsedQuery a generic on query lengthGravatar Luna2022-05-171-2/+2
|
* Make errorFromResultCode publicGravatar luna2022-05-151-0/+1
| | | Useful for direct C API users.
* remove unreachable conditionGravatar Luna2022-05-141-2/+0
|
* add test for single statement in execMultiGravatar Luna2022-05-141-1/+9
|
* rename to execMultiGravatar Luna2022-05-141-2/+2
|
* add newlines and comments to runMulti test caseGravatar Luna2022-05-141-1/+1
|
* fix splitting logic for runMultiGravatar Luna2022-05-141-4/+21
|
* copy options overGravatar Luna2022-05-141-4/+5
|
* add Db.runMultiGravatar Luna2022-05-141-1/+24
|
* add a test for a bind marker with an optional typeGravatar Vincent Rischmann2022-05-031-14/+34
|
* the '_' character is valid in a named bind parameterGravatar Vincent Rischmann2022-05-021-2/+2
|
* put the TODO comment at the end of the line insteadGravatar Vincent Rischmann2022-05-021-9/+3
| | | | | | | | | | When using an explicit error set one must add the "Workaround" error in their error set; putting the explanation as to why it exists at the end of the line makes it so it is displayed directly in the output of the compiler. Before a user had to go look at the source code to understand why we have this workaround.
* Makes sqlite.Error pub.Gravatar Felix "xq" Queißner2022-04-291-1/+2
|