summaryrefslogtreecommitdiff
path: root/sqlite.zig (unfollow)
Commit message (Collapse)AuthorFilesLines
2022-08-06make Statement and ParsedQuery privateprivate-statementGravatar Vincent Rischmann1-2/+2
Users should use `StatementType` instead if they wish to refer to the type of a statement, like this: var stmt: StatementType(.{}, query) = try db.prepare(query); defer stmt.deinit();
2022-08-05move versionGreaterThanOrEqualTo in sqlite.zigGravatar Vincent Rischmann1-0/+5
We will need it later on.
2022-08-05move Text in sqlite.zigGravatar Vincent Rischmann1-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.
2022-08-04move DetailedError, do some cleanupGravatar Vincent Rischmann1-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
2022-08-04use a single cImportGravatar Vincent Rischmann1-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.
2022-08-02no need for 'comptime' for this checkGravatar Vincent Rischmann1-1/+1
A comparison against a const is already comptime.
2022-08-02create a specific CreateFunctionFlag struct based on the SQLite versionGravatar Vincent Rischmann1-2/+16
2022-07-14add a way to get the aggregate context with createAggregateFunctionGravatar Vincent Rischmann1-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
2022-05-24clarify the compile errorGravatar Vincent Rischmann1-1/+1
2022-05-17Make ParsedQuery a generic on query lengthGravatar Luna1-2/+2
2022-05-15Make errorFromResultCode publicGravatar luna1-0/+1
Useful for direct C API users.
2022-05-14remove unreachable conditionGravatar Luna1-2/+0
2022-05-14add test for single statement in execMultiGravatar Luna1-1/+9
2022-05-14rename to execMultiGravatar Luna1-2/+2
2022-05-14add newlines and comments to runMulti test caseGravatar Luna1-1/+1
2022-05-14fix splitting logic for runMultiGravatar Luna1-4/+21
2022-05-14copy options overGravatar Luna1-4/+5
2022-05-14add Db.runMultiGravatar Luna1-1/+24
2022-05-03add a test for a bind marker with an optional typeGravatar Vincent Rischmann1-14/+34
2022-05-02the '_' character is valid in a named bind parameterGravatar Vincent Rischmann1-2/+2
2022-05-02put the TODO comment at the end of the line insteadGravatar Vincent Rischmann1-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.
2022-04-29Makes sqlite.Error pub.Gravatar Felix "xq" Queißner1-1/+2
2022-04-24remove unused assertGravatar Vincent Rischmann1-3/+0
2022-04-24clarify type nameGravatar Vincent Rischmann1-3/+3
2022-04-24add compile error when passing non-struct to Statement.bindGravatar Luna1-0/+5
2022-04-24add test for runtime slices as DynamicStatement argsGravatar Luna1-0/+22
2022-04-24emit compileError on unsupported pointer sizesGravatar Luna1-4/+8
2022-04-24add support for arrays as runtime bind valuesGravatar Luna1-0/+5
2022-04-24allow slices to be passed as bind parametersGravatar Luna1-9/+22
2022-04-23remove the 'opening' logsGravatar Vincent Rischmann1-4/+0
2022-04-23handle tagged union when binding parametersGravatar Vincent Rischmann1-0/+87
2022-04-21add the Db.execAlloc methodGravatar Vincent Rischmann1-0/+19
2022-04-21remove commentGravatar Vincent Rischmann1-3/+0
2022-04-21cleanup the temporary values correctly for enumsGravatar Vincent Rischmann1-26/+42
2022-04-21check explicitly that bindField is implementedGravatar Vincent Rischmann1-1/+7
2022-04-17fix alignCast in the xStep callback of createAggregateFunctionGravatar Vincent Rischmann1-12/+8
2022-04-17factor the CreateFunctionFlag to c_int codeGravatar Vincent Rischmann1-14/+15
2022-04-17work on supporting aggregate SQL functionsGravatar Vincent Rischmann1-78/+259
2022-04-16document CreateFunctionFlagGravatar Vincent Rischmann1-0/+8
2022-04-16constrain the error set of createScalarFunctionGravatar Vincent Rischmann1-1/+1
2022-04-03add createScalarFunction to create a user-defined scalar functionGravatar Vincent Rischmann1-0/+292
2022-04-02only use sqlite3_error_offset if compatibleGravatar Luna1-1/+8
2022-04-02add error offsets to DetailedErrorGravatar Luna1-3/+9
API introduced on 3.38.0
2022-02-05fix sentinelGravatar Vincent Rischmann1-19/+23
2021-12-31add a test for a crash found by fuzzingGravatar Vincent Rischmann1-1/+5
2021-12-31fix savepoint InitErrorGravatar Vincent Rischmann1-0/+3
2021-12-31statement: return an error if using exec() returns dataGravatar Vincent Rischmann1-0/+1
2021-12-31add a test using untyped bind markersGravatar Vincent Rischmann1-0/+19
2021-12-31use StatementTypeGravatar Vincent Rischmann1-4/+2
2021-12-26fix a panic in Statement.prepare if the query is emptyGravatar Vincent Rischmann1-0/+7
sqlite3_prepare_v2 doesn't return an error code if the input query string is empty or is a comment, instead the statement will be null.