xref: /netbsd-src/external/public-domain/sqlite/man/sqlite3_value.3 (revision d16b7486a53dcb8072b60ec6fcb4373a2d0c27b7)
1.Dd December 19, 2018
2.Dt SQLITE3_VALUE 3
3.Os
4.Sh NAME
5.Nm sqlite3_value
6.Nd Dynamically Typed Value Object
7.Sh SYNOPSIS
8.Vt typedef struct sqlite3_value sqlite3_value;
9.Sh DESCRIPTION
10SQLite uses the sqlite3_value object to represent all values that can
11be stored in a database table.
12SQLite uses dynamic typing for the values it stores.
13Values stored in sqlite3_value objects can be integers, floating point
14values, strings, BLOBs, or NULL.
15.Pp
16An sqlite3_value object may be either "protected" or "unprotected".
17Some interfaces require a protected sqlite3_value.
18Other interfaces will accept either a protected or an unprotected sqlite3_value.
19Every interface that accepts sqlite3_value arguments specifies whether
20or not it requires a protected sqlite3_value.
21The sqlite3_value_dup() interface can be used to
22construct a new protected sqlite3_value from an unprotected sqlite3_value.
23.Pp
24The terms "protected" and "unprotected" refer to whether or not a mutex
25is held.
26An internal mutex is held for a protected sqlite3_value object but
27no mutex is held for an unprotected sqlite3_value object.
28If SQLite is compiled to be single-threaded (with SQLITE_THREADSAFE=0
29and with sqlite3_threadsafe() returning 0) or if
30SQLite is run in one of reduced mutex modes SQLITE_CONFIG_SINGLETHREAD
31or SQLITE_CONFIG_MULTITHREAD then there is
32no distinction between protected and unprotected sqlite3_value objects
33and they can be used interchangeably.
34However, for maximum code portability it is recommended that applications
35still make the distinction between protected and unprotected sqlite3_value
36objects even when not strictly required.
37.Pp
38The sqlite3_value objects that are passed as parameters into the implementation
39of application-defined SQL functions
40are protected.
41The sqlite3_value object returned by sqlite3_column_value()
42is unprotected.
43Unprotected sqlite3_value objects may only be used as arguments to
44sqlite3_result_value(), sqlite3_bind_value(),
45and sqlite3_value_dup().
46The  sqlite3_value_type() family of interfaces
47require protected sqlite3_value objects.
48.Sh SEE ALSO
49.Xr sqlite3_create_function 3 ,
50.Xr sqlite3_bind_blob 3 ,
51.Xr sqlite3_column_blob 3 ,
52.Xr sqlite3_result_blob 3 ,
53.Xr sqlite3_threadsafe 3 ,
54.Xr sqlite3_value_blob 3 ,
55.Xr sqlite3_value_dup 3 ,
56.Xr SQLITE_CONFIG_SINGLETHREAD 3
57