diff options
| author | 2021-01-06 02:19:37 +0100 | |
|---|---|---|
| committer | 2021-01-06 02:19:37 +0100 | |
| commit | 8343183ab8279c5b9430a8475014b1b2066b1efc (patch) | |
| tree | 574a71dba93f0965b5083e2656675fb7def04a0b /README.md | |
| parent | Merge pull request #15 from vrischmann/optional (diff) | |
| download | zig-sqlite-8343183ab8279c5b9430a8475014b1b2066b1efc.tar.gz zig-sqlite-8343183ab8279c5b9430a8475014b1b2066b1efc.tar.xz zig-sqlite-8343183ab8279c5b9430a8475014b1b2066b1efc.zip | |
readme: update type mappings rules
Diffstat (limited to '')
| -rw-r--r-- | README.md | 7 |
1 files changed, 5 insertions, 2 deletions
| @@ -277,8 +277,10 @@ Here are the rules for bind parameters: | |||
| 277 | * any Zig `Int` or `ComptimeInt` is treated as a `INTEGER`. | 277 | * any Zig `Int` or `ComptimeInt` is treated as a `INTEGER`. |
| 278 | * any Zig `Float` or `ComptimeFloat` is treated as a `REAL`. | 278 | * any Zig `Float` or `ComptimeFloat` is treated as a `REAL`. |
| 279 | * `[]const u8`, `[]u8` is treated as a `TEXT`. | 279 | * `[]const u8`, `[]u8` is treated as a `TEXT`. |
| 280 | * The custom `sqlite.Blob` type is treated as a `BLOB`. | 280 | * the custom `sqlite.Blob` type is treated as a `BLOB`. |
| 281 | * The custom `sqlite.Text` type is treated as a `TEXT`. | 281 | * the custom `sqlite.Text` type is treated as a `TEXT`. |
| 282 | * the `null` value is treated as a `NULL`. | ||
| 283 | * non-null optionals are treated like a regular value, null optionals are treated as a `NULL`. | ||
| 282 | 284 | ||
| 283 | Here are the rules for resultset rows: | 285 | Here are the rules for resultset rows: |
| 284 | * `INTEGER` can be read into any Zig `Int` provided the data fits. | 286 | * `INTEGER` can be read into any Zig `Int` provided the data fits. |
| @@ -286,6 +288,7 @@ Here are the rules for resultset rows: | |||
| 286 | * `TEXT` can be read into a `[]const u8` or `[]u8`. | 288 | * `TEXT` can be read into a `[]const u8` or `[]u8`. |
| 287 | * `TEXT` can be read into any array of `u8` with a sentinel provided the data fits. | 289 | * `TEXT` can be read into any array of `u8` with a sentinel provided the data fits. |
| 288 | * `BLOB` follows the same rules as `TEXT`. | 290 | * `BLOB` follows the same rules as `TEXT`. |
| 291 | * `NULL` can be read into any optional. | ||
| 289 | 292 | ||
| 290 | Note that arrays must have a sentinel because we need a way to communicate where the data actually stops in the array, so for example use `[200:0]u8` for a `TEXT` field. | 293 | Note that arrays must have a sentinel because we need a way to communicate where the data actually stops in the array, so for example use `[200:0]u8` for a `TEXT` field. |
| 291 | 294 | ||