summaryrefslogtreecommitdiff
path: root/static/netbsd/man3/sqlite3_vtab_collation.3
blob: aa505b95ad5411c2af66ce308cdda3859d56795c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.Dd January 24, 2024
.Dt SQLITE3_VTAB_COLLATION 3
.Os
.Sh NAME
.Nm sqlite3_vtab_collation
.Nd determine the collation for a virtual table constraint
.Sh SYNOPSIS
.In sqlite3.h
.Ft const char *
.Fo sqlite3_vtab_collation
.Fa "sqlite3_index_info*"
.Fa "int"
.Fc
.Sh DESCRIPTION
This function may only be called from within a call to the xBestIndex
method of a virtual table.
This function returns a pointer to a string that is the name of the
appropriate collation sequence to use for text comparisons on the constraint
identified by its arguments.
.Pp
The first argument must be the pointer to the sqlite3_index_info
object that is the first parameter to the xBestIndex() method.
The second argument must be an index into the aConstraint[] array belonging
to the sqlite3_index_info structure passed to xBestIndex.
.Pp
Important: The first parameter must be the same pointer that is passed
into the xBestMethod() method.
The first parameter may not be a pointer to a different sqlite3_index_info
object, even an exact copy.
.Pp
The return value is computed as follows:
.Bl -enum
.It
.Pp
If the constraint comes from a WHERE clause expression that contains
a COLLATE operator, then the name of the collation
specified by that COLLATE operator is returned.
.It
.Pp
If there is no COLLATE operator, but the column that is the subject
of the constraint specifies an alternative collating sequence via a
COLLATE clause on the column definition within the CREATE
TABLE statement that was passed into
.Fn sqlite3_declare_vtab ,
then the name of that alternative collating sequence is returned.
.It
.Pp
Otherwise, "BINARY" is returned.
.El
.Pp
.Sh IMPLEMENTATION NOTES
These declarations were extracted from the
interface documentation at line 9854.
.Bd -literal
SQLITE_API const char *sqlite3_vtab_collation(sqlite3_index_info*,int);
.Ed
.Sh SEE ALSO
.Xr sqlite3_declare_vtab 3 ,
.Xr sqlite3_index_info 3