1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Add streaming version of sqlite3changeset_apply(). Tests and fixes for the same and sqlite3changeset_start_str().

FossilOrigin-Name: b917fc146876f764442de08d5ec36e5b4cf5ab52
This commit is contained in:
dan
2014-09-24 17:13:20 +00:00
parent ef7a630496
commit 4757c65866
6 changed files with 256 additions and 75 deletions

View File

@ -903,6 +903,30 @@ int sqlite3changeset_apply(
void *pCtx /* First argument passed to xConflict */
);
/*
** This function is similar to sqlite3changeset_apply(), except that instead
** of reading data from a single buffer, it requests it one chunk at a time
** from the application by invoking the supplied xInput() callback.
**
** See the documentation for sqlite3changeset_start_str() for a description
** of how the xInput callback should be implemented.
*/
int sqlite3changeset_apply_str(
sqlite3 *db, /* Apply change to "main" db of this handle */
int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
void *pIn, /* First arg for xInput */
int(*xFilter)(
void *pCtx, /* Copy of sixth arg to _apply() */
const char *zTab /* Table name */
),
int(*xConflict)(
void *pCtx, /* Copy of sixth arg to _apply() */
int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
sqlite3_changeset_iter *p /* Handle describing change and conflict */
),
void *pCtx /* First argument passed to xConflict */
);
/*
** CAPI3REF: Constants Passed To The Conflict Handler
**