summaryrefslogtreecommitdiff
path: root/sqlite.zig (unfollow)
Commit message (Collapse)AuthorFilesLines
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.
2021-12-26add tests for crashes found by fuzzingGravatar Vincent Rischmann1-0/+19
2021-12-18fix readArray when reading zero-length blobGravatar Vincent Rischmann1-8/+17
sqlite3_column_blob returns a NULL pointer for a zero-length blob, which must be handled correctly.
2021-12-18add a test binding an empty slice to a text columnGravatar Vincent Rischmann1-0/+67
2021-12-18always deinit the test databaseGravatar Vincent Rischmann1-0/+30
otherwise using the dbfile option won't work
2021-12-18rename argument for clarityGravatar Vincent Rischmann1-3/+3
also style consistency; variables should be snake case
2021-12-01all: replace spanZ with sliceToGravatar Vincent Rischmann1-8/+12
2021-12-01all: fix for latest Allocator interface refactorGravatar Vincent Rischmann1-44/+61
2021-11-22dynamic statement: fix documentationGravatar Vincent Rischmann1-3/+5
2021-11-22dynamic statement: document bind()Gravatar Vincent Rischmann1-0/+33
2021-11-22dynamic statement: add some testsGravatar Vincent Rischmann1-0/+98
2021-11-22dynamic statement: fix one()Gravatar Vincent Rischmann1-1/+1
2021-11-22remove smartBind/bindNamedStruct, they're not actually necessaryGravatar Vincent Rischmann1-33/+11
2021-11-22FixesGravatar Felix "xq" Queißner1-3/+36
2021-11-22A handful of tiny fixes.Gravatar Felix "xq" Queißner1-6/+6
2021-11-07savepoint: always deinit the statementsGravatar Vincent Rischmann1-0/+5
2021-10-23implement savepointGravatar Vincent Rischmann1-0/+250
2021-10-23use explicit error sets everywhereGravatar Vincent Rischmann1-11/+25
2021-10-19sqlite: move to new ParsedQuery and BindMarkerGravatar thisLight1-13/+9
2021-10-18use snake case for field namesGravatar Vincent Rischmann1-3/+3
2021-10-18make bindField clearerGravatar Vincent Rischmann1-34/+52
Be less clever with comptime reflection. This has the advantage of making the code a lot clearer, clearly identifying which case are converting an sqlite int result to an error. This also makes it easier to follow the error trace if there is an error while binding a field.
2021-10-18no need for comptimePrint hereGravatar Vincent Rischmann1-1/+1
2021-10-18improve documentation of DynamicStatementGravatar Vincent Rischmann1-27/+27
2021-10-18Db.getPragmaQuery: use comptimePrint instead of bufPrintGravatar thisLight1-7/+5
2021-10-13add the StatementType functionGravatar Vincent Rischmann1-10/+24
This function returns the type of a statement as would be returned by Db.prepare. Needed to be able to store a statement in a struct.
2021-10-13sqlite: format codeGravatar thisLight1-19/+14
2021-10-13DynamicStatement.translateError: fix typo in nameGravatar thisLight1-2/+2
2021-10-13DynamicStatement.bindField: fix incompatible if branches for optionalsGravatar thisLight1-1/+1
2021-10-13sqlite: some doc fixesGravatar thisLight1-5/+5
2021-10-13DynamicStatment: introduce original sqlite3 statement.Gravatar thisLight1-122/+442
2021-10-12test binding an optional value tooGravatar Vincent Rischmann1-1/+3
2021-10-11fix typoGravatar Vincent Rischmann1-1/+1
2021-10-11fix pragma code, return value must be explicitly ignoredGravatar Vincent Rischmann1-1/+1
2021-10-06use `try` instead of `catch unreachable`Gravatar Meghan Denny1-1/+1
2021-10-06add inserting and reading test for struct BaseType supportGravatar Meghan Denny1-0/+57
2021-09-23add BaseType support for structsGravatar Meghan Denny1-0/+7
2021-09-23add iteratorAlloc and execAllocGravatar Meghan Denny1-2/+30
2021-09-23add options parameter to bind/bindFieldGravatar Meghan Denny1-9/+9
2021-09-07more minor cleanupsGravatar Vincent Rischmann1-10/+4
2021-09-07Stop using anytype in the public API.Gravatar Vincent Rischmann1-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`.
2021-09-04fix for ziglang/zig#9618Gravatar Vincent Rischmann1-12/+15
2021-08-31fix the compile error from readArrayGravatar Vincent Rischmann1-2/+2
2021-08-26implement reading a text column into an enum value directlyGravatar Vincent Rischmann1-0/+39
oneAlloc/nextAlloc can allocate memory so are allowed to use text backed enums.
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.