| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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`.
|
| | |
|
| | |
|
| |
|
|
|
| |
oneAlloc/nextAlloc can allocate memory so are allowed to use text
backed enums.
|
| |
|
|
| |
one/next can't alloc so they are limited to integer values.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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,
});
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |\
| |
| | |
Various fixes
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| |/ |
|
| |
|
|
| |
Fixes #35
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
`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.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|