[BACK]Return to SQLITE_VTAB_CONSTRAINT_SUPPORT.3 CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / external / public-domain / sqlite / man

File: [cvs.NetBSD.org] / src / external / public-domain / sqlite / man / SQLITE_VTAB_CONSTRAINT_SUPPORT.3 (download)

Revision 1.3, Sat Mar 11 16:29:52 2017 UTC (7 years, 1 month ago) by christos
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, phil-wifi-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-compat-base, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, matt-nb8-mediatek-base, matt-nb8-mediatek, bouyer-socketcan-base1
Branch point for: phil-wifi, pgoyette-compat
Changes since 1.2: +1 -1 lines

merge 3.17.0

.Dd March 11, 2017
.Dt SQLITE_VTAB_CONSTRAINT_SUPPORT 3
.Os
.Sh NAME
.Nm SQLITE_VTAB_CONSTRAINT_SUPPORT
.Nd Virtual Table Configuration Options
.Sh SYNOPSIS
.Fd #define SQLITE_VTAB_CONSTRAINT_SUPPORT
.Sh DESCRIPTION
These macros define the various options to the sqlite3_vtab_config()
interface that virtual table implementations can use to
customize and optimize their behavior.
.Bl -tag -width Ds
.It SQLITE_VTAB_CONSTRAINT_SUPPORT Calls of the form sqlite3_vtab_config(db,SQLITE_VTAB_CONSTRAINT_SUPPORT,X)
are supported, where X is an integer.
If X is zero, then the virtual table whose xCreate
or xConnect method invoked sqlite3_vtab_config()
does not support constraints.
In this configuration (which is the default) if a call to the xUpdate
method returns SQLITE_CONSTRAINT, then the entire
statement is rolled back as if  OR ABORT had been specified
as part of the users SQL statement, regardless of the actual ON CONFLICT
mode specified.
.Pp
If X is non-zero, then the virtual table implementation guarantees
that if xUpdate returns SQLITE_CONSTRAINT,
it will do so before any modifications to internal or persistent data
structures have been made.
If the ON CONFLICT mode is ABORT, FAIL, IGNORE or ROLLBACK,
SQLite is able to roll back a statement or database transaction, and
abandon or continue processing the current SQL statement as appropriate.
If the ON CONFLICT mode is REPLACE and the xUpdate method returns
SQLITE_CONSTRAINT, SQLite handles this as if the ON
CONFLICT mode had been ABORT.
.Pp
Virtual table implementations that are required to handle OR REPLACE
must do so within the xUpdate method.
If a call to the sqlite3_vtab_on_conflict()
function indicates that the current ON CONFLICT policy is REPLACE,
the virtual table implementation should silently replace the appropriate
rows within the xUpdate callback and return SQLITE_OK.
Or, if this is not possible, it may return SQLITE_CONSTRAINT, in which
case SQLite falls back to OR ABORT constraint handling.
.El
.Pp
.Sh SEE ALSO
.Xr sqlite3_vtab_config 3 ,
.Xr sqlite3_vtab_on_conflict 3 ,
.Xr SQLITE_OK 3