diff options
author | John Turner <jturner.usa@gmail.com> | 2025-09-14 00:16:10 -0400 |
---|---|---|
committer | John Turner <jturner.usa@gmail.com> | 2025-09-14 00:16:10 -0400 |
commit | 13e0821fd783a1d5083d825af53cf20e8dcbfd76 (patch) | |
tree | 1ea363b0f13b3e87d177100e6ae6b9f30a2de1b8 /subprojects/boost-sqlite/doc/reference/field.adoc | |
parent | aa55cb93036a89c64c08e08f4e1de4fa1fd5a775 (diff) | |
parent | efcea3a80da7c4479d5fe168435ecc9fd06bdc72 (diff) | |
download | sqlite-kv-bench-13e0821fd783a1d5083d825af53cf20e8dcbfd76.tar.gz |
Merge commit 'efcea3a80da7c4479d5fe168435ecc9fd06bdc72' as 'subprojects/boost-sqlite'
Diffstat (limited to 'subprojects/boost-sqlite/doc/reference/field.adoc')
-rw-r--r-- | subprojects/boost-sqlite/doc/reference/field.adoc | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/subprojects/boost-sqlite/doc/reference/field.adoc b/subprojects/boost-sqlite/doc/reference/field.adoc new file mode 100644 index 0000000..572719d --- /dev/null +++ b/subprojects/boost-sqlite/doc/reference/field.adoc @@ -0,0 +1,42 @@ +== `sqlite/field.hpp` + +A `field` is a type representing a <<value>> in a database. or as a result from a query. + +.Definition +[source,cpp] +---- + +struct field +{ + typedef sqlite_int64 int64; + + // The type of the value + value_type type() const; + // Is the held value null + bool is_null() const; + // Is the held value is not null + explicit operator bool () const; + // Returns the value as an `int64`. + int64 get_int() const; + // Returns the value as an `double`. + double get_double() const; + // Returns the value as text, i.e. a string_view. Note that this value may be invalidated + cstring_ref get_text() const; + // Returns the value as blob, i.e. raw memory. Note that this value may be invalidated + blob_view get_blob() const; + // Returns the field as a value. + value get_value() const; + // Returns the name of the column. + cstring_ref column_name() const; + // Returns the name of the table. + cstring_ref table_name() const; + // Returns the name of the original data source. + cstring_ref column_origin_name() const; +} +---- + +NOTE: The view types can be invalidated when the database changes or the next row is read by the query. + +WARNING: The `field` type does not own the statement/query it was produced by. It is a merely a view into the `resultset`. +Reading the next row will change the values returned. + |