diff options
| author | 2021-10-23 14:24:19 +0200 | |
|---|---|---|
| committer | 2021-10-23 16:48:06 +0200 | |
| commit | 78fea7eda5163140d3b084c761621afef0d074e2 (patch) | |
| tree | 13496205990ec36dc274ee87f9e35fdae8be1e7a /query.zig | |
| parent | rename id_type/IdType for naming consistency (diff) | |
| download | zig-sqlite-78fea7eda5163140d3b084c761621afef0d074e2.tar.gz zig-sqlite-78fea7eda5163140d3b084c761621afef0d074e2.tar.xz zig-sqlite-78fea7eda5163140d3b084c761621afef0d074e2.zip | |
document BindMarker
Diffstat (limited to '')
| -rw-r--r-- | query.zig | 11 |
1 files changed, 9 insertions, 2 deletions
| @@ -8,8 +8,15 @@ const Blob = @import("sqlite.zig").Blob; | |||
| 8 | pub const Text = struct { data: []const u8 }; | 8 | pub const Text = struct { data: []const u8 }; |
| 9 | 9 | ||
| 10 | const BindMarker = struct { | 10 | const BindMarker = struct { |
| 11 | typed: ?type = null, // null == untyped | 11 | /// Contains the expected type for a bind parameter which will be checked |
| 12 | /// at comptime when calling bind on a statement. | ||
| 13 | /// | ||
| 14 | /// A null means the bind parameter is untyped so there won't be comptime checking. | ||
| 15 | typed: ?type = null, | ||
| 16 | |||
| 17 | /// Contains the bind parameter identifier string. | ||
| 12 | identifier: ?[]const u8 = null, | 18 | identifier: ?[]const u8 = null, |
| 19 | /// Contains the type of the identifier which is either an integer or a string. | ||
| 13 | identifier_type: IdentifierType = .Integer, | 20 | identifier_type: IdentifierType = .Integer, |
| 14 | 21 | ||
| 15 | pub const IdentifierType = enum { | 22 | pub const IdentifierType = enum { |
| @@ -59,7 +66,7 @@ pub const ParsedQuery = struct { | |||
| 59 | }, | 66 | }, |
| 60 | }, | 67 | }, |
| 61 | .BindMarker => switch (c) { | 68 | .BindMarker => switch (c) { |
| 62 | '?', ':', '@', '$' => @compileError("unregconised multiple '?', ':', '$' or '@'."), | 69 | '?', ':', '@', '$' => @compileError("invalid multiple '?', ':', '$' or '@'."), |
| 63 | '{' => { | 70 | '{' => { |
| 64 | state = .BindMarkerType; | 71 | state = .BindMarkerType; |
| 65 | }, | 72 | }, |