diff options
| author | 2022-08-05 23:00:28 +0200 | |
|---|---|---|
| committer | 2022-08-05 23:00:45 +0200 | |
| commit | 4c492de0f8fef67c41855bd503862874c6a2adce (patch) | |
| tree | 62ed1463261ddfc6241987ca7573f00a306b290f /sqlite.zig | |
| parent | move Text in sqlite.zig (diff) | |
| download | zig-sqlite-4c492de0f8fef67c41855bd503862874c6a2adce.tar.gz zig-sqlite-4c492de0f8fef67c41855bd503862874c6a2adce.tar.xz zig-sqlite-4c492de0f8fef67c41855bd503862874c6a2adce.zip | |
move versionGreaterThanOrEqualTo in sqlite.zig
We will need it later on.
Diffstat (limited to '')
| -rw-r--r-- | sqlite.zig | 5 |
1 files changed, 5 insertions, 0 deletions
| @@ -20,6 +20,11 @@ const getDetailedErrorFromResultCode = errors.getDetailedErrorFromResultCode; | |||
| 20 | 20 | ||
| 21 | const logger = std.log.scoped(.sqlite); | 21 | const logger = std.log.scoped(.sqlite); |
| 22 | 22 | ||
| 23 | // versionGreaterThanOrEqualTo returns true if the SQLite version is >= to the major.minor.patch provided. | ||
| 24 | pub fn versionGreaterThanOrEqualTo(major: u8, minor: u8, patch: u8) bool { | ||
| 25 | return c.SQLITE_VERSION_NUMBER >= @as(u32, major) * 1000000 + @as(u32, minor) * 1000 + @as(u32, patch); | ||
| 26 | } | ||
| 27 | |||
| 23 | /// Text is used to represent a SQLite TEXT value when binding a parameter or reading a column. | 28 | /// Text is used to represent a SQLite TEXT value when binding a parameter or reading a column. |
| 24 | pub const Text = struct { data: []const u8 }; | 29 | pub const Text = struct { data: []const u8 }; |
| 25 | 30 | ||