|
@@ -121,9 +121,9 @@ extern "C" {
|
|
|
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
|
|
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
|
|
|
** [sqlite_version()] and [sqlite_source_id()].
|
|
** [sqlite_version()] and [sqlite_source_id()].
|
|
|
*/
|
|
*/
|
|
|
-#define SQLITE_VERSION "3.17.0"
|
|
|
|
|
-#define SQLITE_VERSION_NUMBER 3017000
|
|
|
|
|
-#define SQLITE_SOURCE_ID "2017-01-28 20:46:37 4fe879d4b5da6ae0688a7a99004683a234966597"
|
|
|
|
|
|
|
+#define SQLITE_VERSION "3.18.0"
|
|
|
|
|
+#define SQLITE_VERSION_NUMBER 3018000
|
|
|
|
|
+#define SQLITE_SOURCE_ID "2017-02-27 17:16:27 23a8917e848a999533bc66467f7cb2f4f3d45bc1"
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
|
** CAPI3REF: Run-Time Library Version Numbers
|
|
** CAPI3REF: Run-Time Library Version Numbers
|
|
@@ -2055,20 +2055,30 @@ SQLITE_API int sqlite3_extended_result_codes(sqlite3*, int onoff);
|
|
|
** the table has a column of type [INTEGER PRIMARY KEY] then that column
|
|
** the table has a column of type [INTEGER PRIMARY KEY] then that column
|
|
|
** is another alias for the rowid.
|
|
** is another alias for the rowid.
|
|
|
**
|
|
**
|
|
|
-** ^The sqlite3_last_insert_rowid(D) interface returns the [rowid] of the
|
|
|
|
|
-** most recent successful [INSERT] into a rowid table or [virtual table]
|
|
|
|
|
-** on database connection D.
|
|
|
|
|
-** ^Inserts into [WITHOUT ROWID] tables are not recorded.
|
|
|
|
|
-** ^If no successful [INSERT]s into rowid tables
|
|
|
|
|
-** have ever occurred on the database connection D,
|
|
|
|
|
-** then sqlite3_last_insert_rowid(D) returns zero.
|
|
|
|
|
-**
|
|
|
|
|
-** ^(If an [INSERT] occurs within a trigger or within a [virtual table]
|
|
|
|
|
-** method, then this routine will return the [rowid] of the inserted
|
|
|
|
|
-** row as long as the trigger or virtual table method is running.
|
|
|
|
|
-** But once the trigger or virtual table method ends, the value returned
|
|
|
|
|
-** by this routine reverts to what it was before the trigger or virtual
|
|
|
|
|
-** table method began.)^
|
|
|
|
|
|
|
+** ^The sqlite3_last_insert_rowid(D) interface usually returns the [rowid] of
|
|
|
|
|
+** the most recent successful [INSERT] into a rowid table or [virtual table]
|
|
|
|
|
+** on database connection D. ^Inserts into [WITHOUT ROWID] tables are not
|
|
|
|
|
+** recorded. ^If no successful [INSERT]s into rowid tables have ever occurred
|
|
|
|
|
+** on the database connection D, then sqlite3_last_insert_rowid(D) returns
|
|
|
|
|
+** zero.
|
|
|
|
|
+**
|
|
|
|
|
+** As well as being set automatically as rows are inserted into database
|
|
|
|
|
+** tables, the value returned by this function may be set explicitly by
|
|
|
|
|
+** [sqlite3_set_last_insert_rowid()]
|
|
|
|
|
+**
|
|
|
|
|
+** Some virtual table implementations may INSERT rows into rowid tables as
|
|
|
|
|
+** part of committing a transaction (e.g. to flush data accumulated in memory
|
|
|
|
|
+** to disk). In this case subsequent calls to this function return the rowid
|
|
|
|
|
+** associated with these internal INSERT operations, which leads to
|
|
|
|
|
+** unintuitive results. Virtual table implementations that do write to rowid
|
|
|
|
|
+** tables in this way can avoid this problem by restoring the original
|
|
|
|
|
+** rowid value using [sqlite3_set_last_insert_rowid()] before returning
|
|
|
|
|
+** control to the user.
|
|
|
|
|
+**
|
|
|
|
|
+** ^(If an [INSERT] occurs within a trigger then this routine will
|
|
|
|
|
+** return the [rowid] of the inserted row as long as the trigger is
|
|
|
|
|
+** running. Once the trigger program ends, the value returned
|
|
|
|
|
+** by this routine reverts to what it was before the trigger was fired.)^
|
|
|
**
|
|
**
|
|
|
** ^An [INSERT] that fails due to a constraint violation is not a
|
|
** ^An [INSERT] that fails due to a constraint violation is not a
|
|
|
** successful [INSERT] and does not change the value returned by this
|
|
** successful [INSERT] and does not change the value returned by this
|
|
@@ -2095,6 +2105,16 @@ SQLITE_API int sqlite3_extended_result_codes(sqlite3*, int onoff);
|
|
|
*/
|
|
*/
|
|
|
SQLITE_API sqlite3_int64 sqlite3_last_insert_rowid(sqlite3*);
|
|
SQLITE_API sqlite3_int64 sqlite3_last_insert_rowid(sqlite3*);
|
|
|
|
|
|
|
|
|
|
+/*
|
|
|
|
|
+** CAPI3REF: Set the Last Insert Rowid value.
|
|
|
|
|
+** METHOD: sqlite3
|
|
|
|
|
+**
|
|
|
|
|
+** The sqlite3_set_last_insert_rowid(D, R) method allows the application to
|
|
|
|
|
+** set the value returned by calling sqlite3_last_insert_rowid(D) to R
|
|
|
|
|
+** without inserting a row into the database.
|
|
|
|
|
+*/
|
|
|
|
|
+SQLITE_API void sqlite3_set_last_insert_rowid(sqlite3*,sqlite3_int64);
|
|
|
|
|
+
|
|
|
/*
|
|
/*
|
|
|
** CAPI3REF: Count The Number Of Rows Modified
|
|
** CAPI3REF: Count The Number Of Rows Modified
|
|
|
** METHOD: sqlite3
|
|
** METHOD: sqlite3
|
|
@@ -8220,7 +8240,7 @@ SQLITE_API int sqlite3_db_cacheflush(sqlite3*);
|
|
|
**
|
|
**
|
|
|
** ^The [sqlite3_preupdate_hook()] interface registers a callback function
|
|
** ^The [sqlite3_preupdate_hook()] interface registers a callback function
|
|
|
** that is invoked prior to each [INSERT], [UPDATE], and [DELETE] operation
|
|
** that is invoked prior to each [INSERT], [UPDATE], and [DELETE] operation
|
|
|
-** on a [rowid table].
|
|
|
|
|
|
|
+** on a database table.
|
|
|
** ^At most one preupdate hook may be registered at a time on a single
|
|
** ^At most one preupdate hook may be registered at a time on a single
|
|
|
** [database connection]; each call to [sqlite3_preupdate_hook()] overrides
|
|
** [database connection]; each call to [sqlite3_preupdate_hook()] overrides
|
|
|
** the previous setting.
|
|
** the previous setting.
|
|
@@ -8229,9 +8249,9 @@ SQLITE_API int sqlite3_db_cacheflush(sqlite3*);
|
|
|
** ^The third parameter to [sqlite3_preupdate_hook()] is passed through as
|
|
** ^The third parameter to [sqlite3_preupdate_hook()] is passed through as
|
|
|
** the first parameter to callbacks.
|
|
** the first parameter to callbacks.
|
|
|
**
|
|
**
|
|
|
-** ^The preupdate hook only fires for changes to [rowid tables]; the preupdate
|
|
|
|
|
-** hook is not invoked for changes to [virtual tables] or [WITHOUT ROWID]
|
|
|
|
|
-** tables.
|
|
|
|
|
|
|
+** ^The preupdate hook only fires for changes to real database tables; the
|
|
|
|
|
+** preupdate hook is not invoked for changes to [virtual tables] or to
|
|
|
|
|
+** system tables like sqlite_master or sqlite_stat1.
|
|
|
**
|
|
**
|
|
|
** ^The second parameter to the preupdate callback is a pointer to
|
|
** ^The second parameter to the preupdate callback is a pointer to
|
|
|
** the [database connection] that registered the preupdate hook.
|
|
** the [database connection] that registered the preupdate hook.
|
|
@@ -8245,12 +8265,16 @@ SQLITE_API int sqlite3_db_cacheflush(sqlite3*);
|
|
|
** databases.)^
|
|
** databases.)^
|
|
|
** ^The fifth parameter to the preupdate callback is the name of the
|
|
** ^The fifth parameter to the preupdate callback is the name of the
|
|
|
** table that is being modified.
|
|
** table that is being modified.
|
|
|
-** ^The sixth parameter to the preupdate callback is the initial [rowid] of the
|
|
|
|
|
-** row being changes for SQLITE_UPDATE and SQLITE_DELETE changes and is
|
|
|
|
|
-** undefined for SQLITE_INSERT changes.
|
|
|
|
|
-** ^The seventh parameter to the preupdate callback is the final [rowid] of
|
|
|
|
|
-** the row being changed for SQLITE_UPDATE and SQLITE_INSERT changes and is
|
|
|
|
|
-** undefined for SQLITE_DELETE changes.
|
|
|
|
|
|
|
+**
|
|
|
|
|
+** For an UPDATE or DELETE operation on a [rowid table], the sixth
|
|
|
|
|
+** parameter passed to the preupdate callback is the initial [rowid] of the
|
|
|
|
|
+** row being modified or deleted. For an INSERT operation on a rowid table,
|
|
|
|
|
+** or any operation on a WITHOUT ROWID table, the value of the sixth
|
|
|
|
|
+** parameter is undefined. For an INSERT or UPDATE on a rowid table the
|
|
|
|
|
+** seventh parameter is the final rowid value of the row being inserted
|
|
|
|
|
+** or updated. The value of the seventh parameter passed to the callback
|
|
|
|
|
+** function is not defined for operations on WITHOUT ROWID tables, or for
|
|
|
|
|
+** INSERT operations on rowid tables.
|
|
|
**
|
|
**
|
|
|
** The [sqlite3_preupdate_old()], [sqlite3_preupdate_new()],
|
|
** The [sqlite3_preupdate_old()], [sqlite3_preupdate_new()],
|
|
|
** [sqlite3_preupdate_count()], and [sqlite3_preupdate_depth()] interfaces
|
|
** [sqlite3_preupdate_count()], and [sqlite3_preupdate_depth()] interfaces
|
|
@@ -8686,7 +8710,7 @@ typedef struct sqlite3_changeset_iter sqlite3_changeset_iter;
|
|
|
** attached database. It is not an error if database zDb is not attached
|
|
** attached database. It is not an error if database zDb is not attached
|
|
|
** to the database when the session object is created.
|
|
** to the database when the session object is created.
|
|
|
*/
|
|
*/
|
|
|
-int sqlite3session_create(
|
|
|
|
|
|
|
+SQLITE_API int sqlite3session_create(
|
|
|
sqlite3 *db, /* Database handle */
|
|
sqlite3 *db, /* Database handle */
|
|
|
const char *zDb, /* Name of db (e.g. "main") */
|
|
const char *zDb, /* Name of db (e.g. "main") */
|
|
|
sqlite3_session **ppSession /* OUT: New session object */
|
|
sqlite3_session **ppSession /* OUT: New session object */
|
|
@@ -8704,7 +8728,7 @@ int sqlite3session_create(
|
|
|
** are attached is closed. Refer to the documentation for
|
|
** are attached is closed. Refer to the documentation for
|
|
|
** [sqlite3session_create()] for details.
|
|
** [sqlite3session_create()] for details.
|
|
|
*/
|
|
*/
|
|
|
-void sqlite3session_delete(sqlite3_session *pSession);
|
|
|
|
|
|
|
+SQLITE_API void sqlite3session_delete(sqlite3_session *pSession);
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -8724,7 +8748,7 @@ void sqlite3session_delete(sqlite3_session *pSession);
|
|
|
** The return value indicates the final state of the session object: 0 if
|
|
** The return value indicates the final state of the session object: 0 if
|
|
|
** the session is disabled, or 1 if it is enabled.
|
|
** the session is disabled, or 1 if it is enabled.
|
|
|
*/
|
|
*/
|
|
|
-int sqlite3session_enable(sqlite3_session *pSession, int bEnable);
|
|
|
|
|
|
|
+SQLITE_API int sqlite3session_enable(sqlite3_session *pSession, int bEnable);
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
|
** CAPI3REF: Set Or Clear the Indirect Change Flag
|
|
** CAPI3REF: Set Or Clear the Indirect Change Flag
|
|
@@ -8753,7 +8777,7 @@ int sqlite3session_enable(sqlite3_session *pSession, int bEnable);
|
|
|
** The return value indicates the final state of the indirect flag: 0 if
|
|
** The return value indicates the final state of the indirect flag: 0 if
|
|
|
** it is clear, or 1 if it is set.
|
|
** it is clear, or 1 if it is set.
|
|
|
*/
|
|
*/
|
|
|
-int sqlite3session_indirect(sqlite3_session *pSession, int bIndirect);
|
|
|
|
|
|
|
+SQLITE_API int sqlite3session_indirect(sqlite3_session *pSession, int bIndirect);
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
|
** CAPI3REF: Attach A Table To A Session Object
|
|
** CAPI3REF: Attach A Table To A Session Object
|
|
@@ -8783,7 +8807,7 @@ int sqlite3session_indirect(sqlite3_session *pSession, int bIndirect);
|
|
|
** SQLITE_OK is returned if the call completes without error. Or, if an error
|
|
** SQLITE_OK is returned if the call completes without error. Or, if an error
|
|
|
** occurs, an SQLite error code (e.g. SQLITE_NOMEM) is returned.
|
|
** occurs, an SQLite error code (e.g. SQLITE_NOMEM) is returned.
|
|
|
*/
|
|
*/
|
|
|
-int sqlite3session_attach(
|
|
|
|
|
|
|
+SQLITE_API int sqlite3session_attach(
|
|
|
sqlite3_session *pSession, /* Session object */
|
|
sqlite3_session *pSession, /* Session object */
|
|
|
const char *zTab /* Table name */
|
|
const char *zTab /* Table name */
|
|
|
);
|
|
);
|
|
@@ -8797,7 +8821,7 @@ int sqlite3session_attach(
|
|
|
** If xFilter returns 0, changes is not tracked. Note that once a table is
|
|
** If xFilter returns 0, changes is not tracked. Note that once a table is
|
|
|
** attached, xFilter will not be called again.
|
|
** attached, xFilter will not be called again.
|
|
|
*/
|
|
*/
|
|
|
-void sqlite3session_table_filter(
|
|
|
|
|
|
|
+SQLITE_API void sqlite3session_table_filter(
|
|
|
sqlite3_session *pSession, /* Session object */
|
|
sqlite3_session *pSession, /* Session object */
|
|
|
int(*xFilter)(
|
|
int(*xFilter)(
|
|
|
void *pCtx, /* Copy of third arg to _filter_table() */
|
|
void *pCtx, /* Copy of third arg to _filter_table() */
|
|
@@ -8910,7 +8934,7 @@ void sqlite3session_table_filter(
|
|
|
** another field of the same row is updated while the session is enabled, the
|
|
** another field of the same row is updated while the session is enabled, the
|
|
|
** resulting changeset will contain an UPDATE change that updates both fields.
|
|
** resulting changeset will contain an UPDATE change that updates both fields.
|
|
|
*/
|
|
*/
|
|
|
-int sqlite3session_changeset(
|
|
|
|
|
|
|
+SQLITE_API int sqlite3session_changeset(
|
|
|
sqlite3_session *pSession, /* Session object */
|
|
sqlite3_session *pSession, /* Session object */
|
|
|
int *pnChangeset, /* OUT: Size of buffer at *ppChangeset */
|
|
int *pnChangeset, /* OUT: Size of buffer at *ppChangeset */
|
|
|
void **ppChangeset /* OUT: Buffer containing changeset */
|
|
void **ppChangeset /* OUT: Buffer containing changeset */
|
|
@@ -8954,7 +8978,8 @@ int sqlite3session_changeset(
|
|
|
** the from-table, a DELETE record is added to the session object.
|
|
** the from-table, a DELETE record is added to the session object.
|
|
|
**
|
|
**
|
|
|
** <li> For each row (primary key) that exists in both tables, but features
|
|
** <li> For each row (primary key) that exists in both tables, but features
|
|
|
-** different in each, an UPDATE record is added to the session.
|
|
|
|
|
|
|
+** different non-PK values in each, an UPDATE record is added to the
|
|
|
|
|
+** session.
|
|
|
** </ul>
|
|
** </ul>
|
|
|
**
|
|
**
|
|
|
** To clarify, if this function is called and then a changeset constructed
|
|
** To clarify, if this function is called and then a changeset constructed
|
|
@@ -8971,7 +8996,7 @@ int sqlite3session_changeset(
|
|
|
** message. It is the responsibility of the caller to free this buffer using
|
|
** message. It is the responsibility of the caller to free this buffer using
|
|
|
** sqlite3_free().
|
|
** sqlite3_free().
|
|
|
*/
|
|
*/
|
|
|
-int sqlite3session_diff(
|
|
|
|
|
|
|
+SQLITE_API int sqlite3session_diff(
|
|
|
sqlite3_session *pSession,
|
|
sqlite3_session *pSession,
|
|
|
const char *zFromDb,
|
|
const char *zFromDb,
|
|
|
const char *zTbl,
|
|
const char *zTbl,
|
|
@@ -9007,7 +9032,7 @@ int sqlite3session_diff(
|
|
|
** a single table are grouped together, tables appear in the order in which
|
|
** a single table are grouped together, tables appear in the order in which
|
|
|
** they were attached to the session object).
|
|
** they were attached to the session object).
|
|
|
*/
|
|
*/
|
|
|
-int sqlite3session_patchset(
|
|
|
|
|
|
|
+SQLITE_API int sqlite3session_patchset(
|
|
|
sqlite3_session *pSession, /* Session object */
|
|
sqlite3_session *pSession, /* Session object */
|
|
|
int *pnPatchset, /* OUT: Size of buffer at *ppChangeset */
|
|
int *pnPatchset, /* OUT: Size of buffer at *ppChangeset */
|
|
|
void **ppPatchset /* OUT: Buffer containing changeset */
|
|
void **ppPatchset /* OUT: Buffer containing changeset */
|
|
@@ -9028,7 +9053,7 @@ int sqlite3session_patchset(
|
|
|
** guaranteed that a call to sqlite3session_changeset() will return a
|
|
** guaranteed that a call to sqlite3session_changeset() will return a
|
|
|
** changeset containing zero changes.
|
|
** changeset containing zero changes.
|
|
|
*/
|
|
*/
|
|
|
-int sqlite3session_isempty(sqlite3_session *pSession);
|
|
|
|
|
|
|
+SQLITE_API int sqlite3session_isempty(sqlite3_session *pSession);
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
|
** CAPI3REF: Create An Iterator To Traverse A Changeset
|
|
** CAPI3REF: Create An Iterator To Traverse A Changeset
|
|
@@ -9063,7 +9088,7 @@ int sqlite3session_isempty(sqlite3_session *pSession);
|
|
|
** the applies to table X, then one for table Y, and then later on visit
|
|
** the applies to table X, then one for table Y, and then later on visit
|
|
|
** another change for table X.
|
|
** another change for table X.
|
|
|
*/
|
|
*/
|
|
|
-int sqlite3changeset_start(
|
|
|
|
|
|
|
+SQLITE_API int sqlite3changeset_start(
|
|
|
sqlite3_changeset_iter **pp, /* OUT: New changeset iterator handle */
|
|
sqlite3_changeset_iter **pp, /* OUT: New changeset iterator handle */
|
|
|
int nChangeset, /* Size of changeset blob in bytes */
|
|
int nChangeset, /* Size of changeset blob in bytes */
|
|
|
void *pChangeset /* Pointer to blob containing changeset */
|
|
void *pChangeset /* Pointer to blob containing changeset */
|
|
@@ -9092,7 +9117,7 @@ int sqlite3changeset_start(
|
|
|
** codes include SQLITE_CORRUPT (if the changeset buffer is corrupt) or
|
|
** codes include SQLITE_CORRUPT (if the changeset buffer is corrupt) or
|
|
|
** SQLITE_NOMEM.
|
|
** SQLITE_NOMEM.
|
|
|
*/
|
|
*/
|
|
|
-int sqlite3changeset_next(sqlite3_changeset_iter *pIter);
|
|
|
|
|
|
|
+SQLITE_API int sqlite3changeset_next(sqlite3_changeset_iter *pIter);
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
|
** CAPI3REF: Obtain The Current Operation From A Changeset Iterator
|
|
** CAPI3REF: Obtain The Current Operation From A Changeset Iterator
|
|
@@ -9120,7 +9145,7 @@ int sqlite3changeset_next(sqlite3_changeset_iter *pIter);
|
|
|
** SQLite error code is returned. The values of the output variables may not
|
|
** SQLite error code is returned. The values of the output variables may not
|
|
|
** be trusted in this case.
|
|
** be trusted in this case.
|
|
|
*/
|
|
*/
|
|
|
-int sqlite3changeset_op(
|
|
|
|
|
|
|
+SQLITE_API int sqlite3changeset_op(
|
|
|
sqlite3_changeset_iter *pIter, /* Iterator object */
|
|
sqlite3_changeset_iter *pIter, /* Iterator object */
|
|
|
const char **pzTab, /* OUT: Pointer to table name */
|
|
const char **pzTab, /* OUT: Pointer to table name */
|
|
|
int *pnCol, /* OUT: Number of columns in table */
|
|
int *pnCol, /* OUT: Number of columns in table */
|
|
@@ -9153,7 +9178,7 @@ int sqlite3changeset_op(
|
|
|
** SQLITE_OK is returned and the output variables populated as described
|
|
** SQLITE_OK is returned and the output variables populated as described
|
|
|
** above.
|
|
** above.
|
|
|
*/
|
|
*/
|
|
|
-int sqlite3changeset_pk(
|
|
|
|
|
|
|
+SQLITE_API int sqlite3changeset_pk(
|
|
|
sqlite3_changeset_iter *pIter, /* Iterator object */
|
|
sqlite3_changeset_iter *pIter, /* Iterator object */
|
|
|
unsigned char **pabPK, /* OUT: Array of boolean - true for PK cols */
|
|
unsigned char **pabPK, /* OUT: Array of boolean - true for PK cols */
|
|
|
int *pnCol /* OUT: Number of entries in output array */
|
|
int *pnCol /* OUT: Number of entries in output array */
|
|
@@ -9183,7 +9208,7 @@ int sqlite3changeset_pk(
|
|
|
** If some other error occurs (e.g. an OOM condition), an SQLite error code
|
|
** If some other error occurs (e.g. an OOM condition), an SQLite error code
|
|
|
** is returned and *ppValue is set to NULL.
|
|
** is returned and *ppValue is set to NULL.
|
|
|
*/
|
|
*/
|
|
|
-int sqlite3changeset_old(
|
|
|
|
|
|
|
+SQLITE_API int sqlite3changeset_old(
|
|
|
sqlite3_changeset_iter *pIter, /* Changeset iterator */
|
|
sqlite3_changeset_iter *pIter, /* Changeset iterator */
|
|
|
int iVal, /* Column number */
|
|
int iVal, /* Column number */
|
|
|
sqlite3_value **ppValue /* OUT: Old value (or NULL pointer) */
|
|
sqlite3_value **ppValue /* OUT: Old value (or NULL pointer) */
|
|
@@ -9216,7 +9241,7 @@ int sqlite3changeset_old(
|
|
|
** If some other error occurs (e.g. an OOM condition), an SQLite error code
|
|
** If some other error occurs (e.g. an OOM condition), an SQLite error code
|
|
|
** is returned and *ppValue is set to NULL.
|
|
** is returned and *ppValue is set to NULL.
|
|
|
*/
|
|
*/
|
|
|
-int sqlite3changeset_new(
|
|
|
|
|
|
|
+SQLITE_API int sqlite3changeset_new(
|
|
|
sqlite3_changeset_iter *pIter, /* Changeset iterator */
|
|
sqlite3_changeset_iter *pIter, /* Changeset iterator */
|
|
|
int iVal, /* Column number */
|
|
int iVal, /* Column number */
|
|
|
sqlite3_value **ppValue /* OUT: New value (or NULL pointer) */
|
|
sqlite3_value **ppValue /* OUT: New value (or NULL pointer) */
|
|
@@ -9243,7 +9268,7 @@ int sqlite3changeset_new(
|
|
|
** If some other error occurs (e.g. an OOM condition), an SQLite error code
|
|
** If some other error occurs (e.g. an OOM condition), an SQLite error code
|
|
|
** is returned and *ppValue is set to NULL.
|
|
** is returned and *ppValue is set to NULL.
|
|
|
*/
|
|
*/
|
|
|
-int sqlite3changeset_conflict(
|
|
|
|
|
|
|
+SQLITE_API int sqlite3changeset_conflict(
|
|
|
sqlite3_changeset_iter *pIter, /* Changeset iterator */
|
|
sqlite3_changeset_iter *pIter, /* Changeset iterator */
|
|
|
int iVal, /* Column number */
|
|
int iVal, /* Column number */
|
|
|
sqlite3_value **ppValue /* OUT: Value from conflicting row */
|
|
sqlite3_value **ppValue /* OUT: Value from conflicting row */
|
|
@@ -9259,7 +9284,7 @@ int sqlite3changeset_conflict(
|
|
|
**
|
|
**
|
|
|
** In all other cases this function returns SQLITE_MISUSE.
|
|
** In all other cases this function returns SQLITE_MISUSE.
|
|
|
*/
|
|
*/
|
|
|
-int sqlite3changeset_fk_conflicts(
|
|
|
|
|
|
|
+SQLITE_API int sqlite3changeset_fk_conflicts(
|
|
|
sqlite3_changeset_iter *pIter, /* Changeset iterator */
|
|
sqlite3_changeset_iter *pIter, /* Changeset iterator */
|
|
|
int *pnOut /* OUT: Number of FK violations */
|
|
int *pnOut /* OUT: Number of FK violations */
|
|
|
);
|
|
);
|
|
@@ -9292,7 +9317,7 @@ int sqlite3changeset_fk_conflicts(
|
|
|
** // An error has occurred
|
|
** // An error has occurred
|
|
|
** }
|
|
** }
|
|
|
*/
|
|
*/
|
|
|
-int sqlite3changeset_finalize(sqlite3_changeset_iter *pIter);
|
|
|
|
|
|
|
+SQLITE_API int sqlite3changeset_finalize(sqlite3_changeset_iter *pIter);
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
|
** CAPI3REF: Invert A Changeset
|
|
** CAPI3REF: Invert A Changeset
|
|
@@ -9322,7 +9347,7 @@ int sqlite3changeset_finalize(sqlite3_changeset_iter *pIter);
|
|
|
** WARNING/TODO: This function currently assumes that the input is a valid
|
|
** WARNING/TODO: This function currently assumes that the input is a valid
|
|
|
** changeset. If it is not, the results are undefined.
|
|
** changeset. If it is not, the results are undefined.
|
|
|
*/
|
|
*/
|
|
|
-int sqlite3changeset_invert(
|
|
|
|
|
|
|
+SQLITE_API int sqlite3changeset_invert(
|
|
|
int nIn, const void *pIn, /* Input changeset */
|
|
int nIn, const void *pIn, /* Input changeset */
|
|
|
int *pnOut, void **ppOut /* OUT: Inverse of input */
|
|
int *pnOut, void **ppOut /* OUT: Inverse of input */
|
|
|
);
|
|
);
|
|
@@ -9351,7 +9376,7 @@ int sqlite3changeset_invert(
|
|
|
**
|
|
**
|
|
|
** Refer to the sqlite3_changegroup documentation below for details.
|
|
** Refer to the sqlite3_changegroup documentation below for details.
|
|
|
*/
|
|
*/
|
|
|
-int sqlite3changeset_concat(
|
|
|
|
|
|
|
+SQLITE_API int sqlite3changeset_concat(
|
|
|
int nA, /* Number of bytes in buffer pA */
|
|
int nA, /* Number of bytes in buffer pA */
|
|
|
void *pA, /* Pointer to buffer containing changeset A */
|
|
void *pA, /* Pointer to buffer containing changeset A */
|
|
|
int nB, /* Number of bytes in buffer pB */
|
|
int nB, /* Number of bytes in buffer pB */
|
|
@@ -9539,7 +9564,7 @@ void sqlite3changegroup_delete(sqlite3_changegroup*);
|
|
|
** <ul>
|
|
** <ul>
|
|
|
** <li> The table has the same name as the name recorded in the
|
|
** <li> The table has the same name as the name recorded in the
|
|
|
** changeset, and
|
|
** changeset, and
|
|
|
-** <li> The table has the same number of columns as recorded in the
|
|
|
|
|
|
|
+** <li> The table has at least as many columns as recorded in the
|
|
|
** changeset, and
|
|
** changeset, and
|
|
|
** <li> The table has primary key columns in the same position as
|
|
** <li> The table has primary key columns in the same position as
|
|
|
** recorded in the changeset.
|
|
** recorded in the changeset.
|
|
@@ -9584,7 +9609,11 @@ void sqlite3changegroup_delete(sqlite3_changegroup*);
|
|
|
** If a row with matching primary key values is found, but one or more of
|
|
** If a row with matching primary key values is found, but one or more of
|
|
|
** the non-primary key fields contains a value different from the original
|
|
** the non-primary key fields contains a value different from the original
|
|
|
** row value stored in the changeset, the conflict-handler function is
|
|
** row value stored in the changeset, the conflict-handler function is
|
|
|
-** invoked with [SQLITE_CHANGESET_DATA] as the second argument.
|
|
|
|
|
|
|
+** invoked with [SQLITE_CHANGESET_DATA] as the second argument. If the
|
|
|
|
|
+** database table has more columns than are recorded in the changeset,
|
|
|
|
|
+** only the values of those non-primary key fields are compared against
|
|
|
|
|
+** the current database contents - any trailing database table columns
|
|
|
|
|
+** are ignored.
|
|
|
**
|
|
**
|
|
|
** If no row with matching primary key values is found in the database,
|
|
** If no row with matching primary key values is found in the database,
|
|
|
** the conflict-handler function is invoked with [SQLITE_CHANGESET_NOTFOUND]
|
|
** the conflict-handler function is invoked with [SQLITE_CHANGESET_NOTFOUND]
|
|
@@ -9599,7 +9628,9 @@ void sqlite3changegroup_delete(sqlite3_changegroup*);
|
|
|
**
|
|
**
|
|
|
** <dt>INSERT Changes<dd>
|
|
** <dt>INSERT Changes<dd>
|
|
|
** For each INSERT change, an attempt is made to insert the new row into
|
|
** For each INSERT change, an attempt is made to insert the new row into
|
|
|
-** the database.
|
|
|
|
|
|
|
+** the database. If the changeset row contains fewer fields than the
|
|
|
|
|
+** database table, the trailing fields are populated with their default
|
|
|
|
|
+** values.
|
|
|
**
|
|
**
|
|
|
** If the attempt to insert the row fails because the database already
|
|
** If the attempt to insert the row fails because the database already
|
|
|
** contains a row with the same primary key values, the conflict handler
|
|
** contains a row with the same primary key values, the conflict handler
|
|
@@ -9617,13 +9648,13 @@ void sqlite3changegroup_delete(sqlite3_changegroup*);
|
|
|
** For each UPDATE change, this function checks if the target database
|
|
** For each UPDATE change, this function checks if the target database
|
|
|
** contains a row with the same primary key value (or values) as the
|
|
** contains a row with the same primary key value (or values) as the
|
|
|
** original row values stored in the changeset. If it does, and the values
|
|
** original row values stored in the changeset. If it does, and the values
|
|
|
-** stored in all non-primary key columns also match the values stored in
|
|
|
|
|
-** the changeset the row is updated within the target database.
|
|
|
|
|
|
|
+** stored in all modified non-primary key columns also match the values
|
|
|
|
|
+** stored in the changeset the row is updated within the target database.
|
|
|
**
|
|
**
|
|
|
** If a row with matching primary key values is found, but one or more of
|
|
** If a row with matching primary key values is found, but one or more of
|
|
|
-** the non-primary key fields contains a value different from an original
|
|
|
|
|
-** row value stored in the changeset, the conflict-handler function is
|
|
|
|
|
-** invoked with [SQLITE_CHANGESET_DATA] as the second argument. Since
|
|
|
|
|
|
|
+** the modified non-primary key fields contains a value different from an
|
|
|
|
|
+** original row value stored in the changeset, the conflict-handler function
|
|
|
|
|
+** is invoked with [SQLITE_CHANGESET_DATA] as the second argument. Since
|
|
|
** UPDATE changes only contain values for non-primary key fields that are
|
|
** UPDATE changes only contain values for non-primary key fields that are
|
|
|
** to be modified, only those fields need to match the original values to
|
|
** to be modified, only those fields need to match the original values to
|
|
|
** avoid the SQLITE_CHANGESET_DATA conflict-handler callback.
|
|
** avoid the SQLITE_CHANGESET_DATA conflict-handler callback.
|
|
@@ -9651,7 +9682,7 @@ void sqlite3changegroup_delete(sqlite3_changegroup*);
|
|
|
** rolled back, restoring the target database to its original state, and an
|
|
** rolled back, restoring the target database to its original state, and an
|
|
|
** SQLite error code returned.
|
|
** SQLite error code returned.
|
|
|
*/
|
|
*/
|
|
|
-int sqlite3changeset_apply(
|
|
|
|
|
|
|
+SQLITE_API int sqlite3changeset_apply(
|
|
|
sqlite3 *db, /* Apply change to "main" db of this handle */
|
|
sqlite3 *db, /* Apply change to "main" db of this handle */
|
|
|
int nChangeset, /* Size of changeset in bytes */
|
|
int nChangeset, /* Size of changeset in bytes */
|
|
|
void *pChangeset, /* Changeset blob */
|
|
void *pChangeset, /* Changeset blob */
|
|
@@ -9852,7 +9883,7 @@ int sqlite3changeset_apply(
|
|
|
** parameter set to a value less than or equal to zero. Other than this,
|
|
** parameter set to a value less than or equal to zero. Other than this,
|
|
|
** no guarantees are made as to the size of the chunks of data returned.
|
|
** no guarantees are made as to the size of the chunks of data returned.
|
|
|
*/
|
|
*/
|
|
|
-int sqlite3changeset_apply_strm(
|
|
|
|
|
|
|
+SQLITE_API int sqlite3changeset_apply_strm(
|
|
|
sqlite3 *db, /* Apply change to "main" db of this handle */
|
|
sqlite3 *db, /* Apply change to "main" db of this handle */
|
|
|
int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
|
|
int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
|
|
|
void *pIn, /* First arg for xInput */
|
|
void *pIn, /* First arg for xInput */
|
|
@@ -9867,7 +9898,7 @@ int sqlite3changeset_apply_strm(
|
|
|
),
|
|
),
|
|
|
void *pCtx /* First argument passed to xConflict */
|
|
void *pCtx /* First argument passed to xConflict */
|
|
|
);
|
|
);
|
|
|
-int sqlite3changeset_concat_strm(
|
|
|
|
|
|
|
+SQLITE_API int sqlite3changeset_concat_strm(
|
|
|
int (*xInputA)(void *pIn, void *pData, int *pnData),
|
|
int (*xInputA)(void *pIn, void *pData, int *pnData),
|
|
|
void *pInA,
|
|
void *pInA,
|
|
|
int (*xInputB)(void *pIn, void *pData, int *pnData),
|
|
int (*xInputB)(void *pIn, void *pData, int *pnData),
|
|
@@ -9875,23 +9906,23 @@ int sqlite3changeset_concat_strm(
|
|
|
int (*xOutput)(void *pOut, const void *pData, int nData),
|
|
int (*xOutput)(void *pOut, const void *pData, int nData),
|
|
|
void *pOut
|
|
void *pOut
|
|
|
);
|
|
);
|
|
|
-int sqlite3changeset_invert_strm(
|
|
|
|
|
|
|
+SQLITE_API int sqlite3changeset_invert_strm(
|
|
|
int (*xInput)(void *pIn, void *pData, int *pnData),
|
|
int (*xInput)(void *pIn, void *pData, int *pnData),
|
|
|
void *pIn,
|
|
void *pIn,
|
|
|
int (*xOutput)(void *pOut, const void *pData, int nData),
|
|
int (*xOutput)(void *pOut, const void *pData, int nData),
|
|
|
void *pOut
|
|
void *pOut
|
|
|
);
|
|
);
|
|
|
-int sqlite3changeset_start_strm(
|
|
|
|
|
|
|
+SQLITE_API int sqlite3changeset_start_strm(
|
|
|
sqlite3_changeset_iter **pp,
|
|
sqlite3_changeset_iter **pp,
|
|
|
int (*xInput)(void *pIn, void *pData, int *pnData),
|
|
int (*xInput)(void *pIn, void *pData, int *pnData),
|
|
|
void *pIn
|
|
void *pIn
|
|
|
);
|
|
);
|
|
|
-int sqlite3session_changeset_strm(
|
|
|
|
|
|
|
+SQLITE_API int sqlite3session_changeset_strm(
|
|
|
sqlite3_session *pSession,
|
|
sqlite3_session *pSession,
|
|
|
int (*xOutput)(void *pOut, const void *pData, int nData),
|
|
int (*xOutput)(void *pOut, const void *pData, int nData),
|
|
|
void *pOut
|
|
void *pOut
|
|
|
);
|
|
);
|
|
|
-int sqlite3session_patchset_strm(
|
|
|
|
|
|
|
+SQLITE_API int sqlite3session_patchset_strm(
|
|
|
sqlite3_session *pSession,
|
|
sqlite3_session *pSession,
|
|
|
int (*xOutput)(void *pOut, const void *pData, int nData),
|
|
int (*xOutput)(void *pOut, const void *pData, int nData),
|
|
|
void *pOut
|
|
void *pOut
|