Lines Matching refs:main
2345 ** points to a buffer containing the name of the main database file. If the
2527 ** triggers in the main database schema or in the schemas of ATTACH-ed
2544 ** views in the main database schema or in the schemas of ATTACH-ed
2580 ** <dd> ^This option is used to change the name of the "main" database
2582 ** which will become the new schema name in place of "main". ^SQLite
2583 ** does not make a copy of the new main schema name string, so the application
3495 ** authorizer callback is the name of the database ("main", "temp",
4047 ** in addition to the main database file. Prior to version 3.31.0, these
4048 ** routines would only work if F was the name of the main database file.
4051 ** main database file.
4064 ** translating filenames between the main database file, the journal file,
4097 ** object that represents the main database file.
6692 ** out of range. An N value of 0 means the main database file. An N of 1 is
7163 ** (i.e. "main", "temp", or an attached database) containing the specified
7809 ** For the main database file, the database name is "main". For TEMP
8337 ** name of the database is "main" for the main database or "temp" for the
8340 ** ^A NULL pointer can be used in place of "main" to refer to the
8341 ** main database file.
8355 ** the main database. The [SQLITE_FCNTL_VFS_POINTER] opcode returns
8816 ** with the connection - main, temp, and any [ATTACH]-ed databases.)^
9258 ** ^The database name is "main" for the main database, "temp" for the
9632 ** either "main" or the name of an [ATTACH]-ed database. ^The fourth parameter
10302 ** subquery the loop is part of. The main query has a select-id of zero.
10373 ** interface flushes caches for all schemas - "main", "temp", and
10425 ** will be "main" for the main database or "temp" for TEMP tables or
10750 const char *zSchema, /* Which DB to serialize. ex: "main", "temp", ... */
11026 ** database zDb, where zDb is either "main", or "temp", or the name of an
11032 const char *zDb, /* Name of db (e.g. "main") */
11353 ** Argument zFromDb must be the name of a database ("main", "temp" etc.)
12008 ** update the "main" database attached to handle db with the changes found in
12163 sqlite3 *db, /* Apply change to "main" db of this handle */
12178 sqlite3 *db, /* Apply change to "main" db of this handle */
12561 sqlite3 *db, /* Apply change to "main" db of this handle */
12576 sqlite3 *db, /* Apply change to "main" db of this handle */
13387 ** the main database table and for temporary tables.
13410 ** and we have to allow 2 extra counts for the "main" and "temp" databases.
15647 ** the main table row automatically deletes corresponding index rows,
16648 /* Try to return memory used by the pcache module to the main memory heap */
16784 ** in the sqlite.aDb[] array. aDb[0] is the main database file and
17001 ** databases plus 2 for "main" and "temp".
19107 sqlite3 *db; /* The main database structure */
19150 Parse *pToplevel; /* Parse structure for main program (or NULL) */
19434 int iDb; /* 0 for main database. 1 for TEMP, 2.. for ATTACHed */
22477 ** - In the main database or in an ephemeral database
22575 ** set to NULL if the currently executing frame is the main program.
22580 VdbeFrame *pParent; /* Parent of this frame, or NULL if parent is main */
22687 ** Usually this is encoded in the same unicode encoding as the main
23387 ** to store the schema for all databases (main, temp, and any ATTACHed
32805 ** "thread" is done by the main thread at either the sqlite3ThreadCreate()
32998 ** work of the thread in the main thread, when either the thread is created
38305 /* These verifications occurs for the main database only */
42949 /* If this is a main database file and the file was opened using a URI
43010 /* If creating a super- or main-file journal, this function will open
43038 /* The main DB, main journal, WAL file and super-journal are never
46366 MUTEX_LOGIC( sqlite3_mutex *pMainMtx; ) /* The main static mutex */
46376 ** the heap. Also, since both the main and memsys locks are currently
50147 /* The main DB, main journal, WAL file and super-journal are never
54406 ** for these steps, the main pcache1Fetch() procedure can run faster.
55920 ** set to 0. If a journal-header is written into the main journal while
55922 ** immediately following the last journal record written into the main
55928 i64 iOffset; /* Starting offset in main journal */
56157 sqlite3_file *jfd; /* File descriptor for main journal */
57745 ** The main rollback journal uses checksums - the statement journal does
57767 ** * If the record is being rolled back from the main journal file
57780 int isMainJrnl, /* 1 -> main journal. 0 -> sub-journal. */
57809 ** only reads from the main journal, not the sub-journal.
57871 ** pager cache if it exists and the main file. The page is then marked
57881 ** for certain that original page contents are synced into the main rollback
57887 ** in the main journal either because the page is not in cache or else
57903 (isMainJrnl?"main-journal":"sub-journal")
58150 ** If the main database file is not open, or the pager is not in either
58890 ** * Pages are played back from the main journal starting at byte
58892 ** PagerSavepoint.iHdrOffset, or to the end of the main journal
58897 ** PagerSavepoint.iHdrOffset to the end of the main journal file.
58908 ** If pSavepoint is NULL, then pages are only played back from the main
58917 i64 szJ; /* Effective size of the main journal */
58918 i64 iHdrOff; /* End of first segment of main-journal records */
58943 /* Use pPager->journalOff as the effective size of the main rollback
58951 /* Begin by rolling back records from the main journal starting at
58953 ** There might be records in the main journal that have a page number
58969 /* Continue rolling back records out of the main journal starting at
58971 ** of the main journal file. Continue to skip out-of-range pages and
58999 ** previously rolled back out of the main journal (and are hence in pDone)
60274 ** (there are two of them, the main journal and the sub-journal). */
60385 ROUND8(pVfs->szOsFile) + /* The main db file */
60611 ** Return the sqlite3_file for the main database given the name
61550 ** main journal or sub-journal as required. If the page is written into
67375 ** lock on the main database file.
67382 ** on the main database file before invoking this operation.
68051 u16 nSize; /* Size of the cell content on the main b-tree page */
70727 BtShared *pBt; /* The main btree structure */
73043 ** back independently of the main transaction. You must start a transaction
73045 ** if the main transaction commits or rolls back.
73562 ** The content being read or written might appear on the main page
74375 ** single byte varint and the record fits entirely on the main
74383 ** fits entirely on the main b-tree page. */
74544 ** single byte varint and the record fits entirely on the main
74552 ** fits entirely on the main b-tree page. */
74687 ** The main entry point is sqlite3BtreeNext(). That routine is optimized
74780 ** The main entry point is sqlite3BtreePrevious(). That routine is optimized
79820 ** Return a pointer corresponding to database zDb (i.e. "main", "temp")
83153 ** in a Vdbe main program and each of the sub-programs (triggers) it may
83173 int iSub; /* 0 = main program, 1 = first sub-program etc. */
83222 ** to be rolled back). This condition is true if the main program or any
84646 ** nRow is the sum of the number of rows in the main program, plus
84673 ** main program. */
84766 ** are also shown, so that the boundaries between the main program and
84769 ** When p->explain==1, first the main program is listed, then each of
85183 ** control to the main program.
85370 ** string, it means the main database is :memory: or a temp file. In
85967 ** and error message from the VDBE into the main database structure. But
85969 ** instructions yet, leave the main database error information unchanged.
94234 ** started. Index 0 is the main database file and index 1 is the
94365 ** the main database file and P1==1 is the database file used to store
94396 ** size, and so forth. P1==0 is the main database file and P1==1 is the
94443 ** P3==0 means the main database, P3==1 means the database used for
94671 ** the main database is read-only. The ephemeral
96996 ** The table being destroyed is in the main database file if P3==0. If
97057 ** The table being clear is in the main database file if P2==0. If
97116 ** Allocate a new b-tree in the main database file if P1==0 or in the
97308 ** file, not the main database file.
98148 ** Vacuum the entire database P1. P1 is 0 for "main", and 2 or more
99848 ** unsorted in main memory. Assuming the amount of memory used never exceeds
99852 ** directly from main memory.
99854 ** If the amount of space used to store records in main memory exceeds the
99861 ** The threshold for the amount of main memory to use before flushing
99863 ** page-cache of the main database. Specifically, the threshold is set to
99864 ** the value returned by "PRAGMA main.page_size" multipled by
99865 ** that returned by "PRAGMA main.cache_size", in bytes.
99873 ** there are already N worker threads running, the main thread does the work
99893 ** merged T bytes of data into a single sorted PMA, the main thread
99912 ** the main thread to read from.
100044 ** (see SQLITE_CONFIG_WORKER_THREADS) plus one (the main thread). Thus for
100059 ** active background thread (since doing so causes the main thread
100066 ** In both cases, the effects of the main thread seeing (bDone==0) even
100709 int pgsz; /* Page size of main database */
100731 /* Do not allow the total number of threads (main thread + all workers)
100827 ** from the main thread. That only occurs SQLITE_MAX_WORKER_THREADS>0 */
100875 fprintf(stderr, "%lld:main %s\n", t, zEvent);
100927 /* This function is always called by the main user thread.
101457 ** The main routine for background threads that write level-0 PMAs.
101494 ** sub-task uses the main thread. */
101694 ** The main routine for background threads that populate aFile[1] of
101917 ** the main thread to fill its buffer. So calling PmaReaderNext()
102012 ** main VDBE thread. But that is Ok, as that thread cannot return
102030 ** The main routine for vdbePmaReaderIncrMergeInit() operations run in
102818 break; /* Result is NULL for the main program */
102856 ** idxNum==1 means show only the main bytecode and omit subprograms.
103319 ** all content is always stored in main-memory. Finally, if nSpill is a
103705 ** incrAggFunctionDepth(pExpr,n) is the main routine. incrAggDepth(..)
103959 if( i==db->nDb && sqlite3StrICmp("main", zDb)==0 ){
103960 /* This branch is taken when the main database has been renamed
105609 ** X: The name of a database. Ex: "main" or "temp" or
113771 ** 3. Database: Database name (e.g. "main")
114009 ** sqlite_rename_table('main', 'CREATE TABLE t1(a REFERENCES t2)','t2','t3',0)
114178 ** 0: Database name ("main", "temp" etc.).
114186 ** SELECT sqlite_rename_quotefix('main',
114295 ** 0: Database name ("main", "temp" etc.).
114455 const char *zDb; /* Database containing pTab ("main" etc.) */
114878 i64 iRowid; /* Rowid in main table of the key */
116318 const char *zDb /* Database name (e.g. "main") */
116601 || (iDb==0 && sqlite3StrICmp("main", zName)==0)
116728 "attached databases must use the same text encoding as main database");
116770 ** use the key from the main database. */
117661 ** (Bit 0 is for main, bit 1 is for temp, and so forth.) Bits are
117830 /* No match against the official names. But always match "main"
117832 if( sqlite3StrICmp(zDatabase,"main")==0 ){
117859 /* The main database is second */
118067 ** Entry 0 (the "main" database) and entry 1 (the "temp" database)
118119 ** "main" and "temp") for a single database connection.
118411 ** of a database ("main", "temp" or the name of an attached db). This
118421 /* "main" is always an acceptable alias for the primary database
118423 if( i==0 && 0==sqlite3_stricmp("main", zName) ) break;
118430 ** The token *pName contains the name of a database (either "main" or
118674 ** file instead of in the main database file. This is normally the case
119798 ** schema to the rootpage from the main table.
120244 ** file instead of into the main database file.
120404 ** then record a pointer to this table in the main database structure
120563 ** CREATE TABLE main.ex1(a);
121289 ** a different order from the main table.
123232 ** from the main database is substituted, if one is available.
129293 sqlite3 *db; /* The main database structure */
129300 int iDataCur = 0; /* VDBE cursor that is the main data repository */
129697 /* This is the top of the main insertion loop */
129986 /* The bottom of the main insertion loop, if the data source
130213 ** main table, if pTab is a rowid table, and stores that record in the
130220 ** The caller must have already opened writeable cursors on the main
130222 ** aRegIdx[] is not zero). iDataCur is the cursor for the main table when
130272 int iDataCur, /* Canonical data cursor (main table or PK index) */
131583 ** But the main beneficiary of the transfer optimization is the VACUUM
132308 ** (part of the main SQLite library - not an extension) so that
132310 ** definition. But the main library does not want to redefine
133629 #define PragFlg_SchemaReq 0x80 /* Schema required - "main" is default */
134903 ** the locking-mode of the main database).
134911 ** set on all attached databases, as well as the main db file.
134969 /* Convert "PRAGMA journal_mode" into "PRAGMA main.journal_mode" */
136311 ** In its first form, this pragma returns the encoding of the main
136314 ** The second form of this pragma is a no-op if the main database file
136316 ** encoding that will be used for the main database file if a new file
136317 ** is created. If an existing main database file is opened, then the
136321 ** created to use the same default text encoding as the main database. If
136322 ** the main database has not been initialized and/or created when ATTACH
136327 ** useful if invoked immediately after the main database i
136353 ** initialized. If the main database exists, the new sqlite.enc value
137336 ** database file is given by iDb. iDb==0 is used for the main
137438 ** main database, set sqlite3.enc to the encoding of the main database.
137446 /* If opening the main database, set ENC(db). */
137457 " text encoding as main database");
137572 ** Initialize all database files - the main database file, the file
137589 /* Do the main schema first */
137594 /* All other schemas after the main schema. The "temp" schema must be last */
141933 /* Implement the main merge loop
143713 /* The FROM term contains a schema qualifier (ex: main.t1) and so
145023 ** reduction of join operators) in the FROM clause up into the main query
146174 ** interface routines. These are just wrappers around the main
148147 int *aRegIdx = 0; /* Registers for to each index and the main table */
148254 /* Allocate a cursors for the main database table and for all indices.
148449 ** reallocated. aRegIdx[nAllIdx] is the register in which the main
149718 ** (possibly synchronous) transaction opened on the main database before
149768 /* Begin a transaction and take an exclusive lock on the main database
149798 /* Query the schema of the main database. Create a mirror schema
149817 /* Loop through the tables in the main database. For each, do
149818 ** an "INSERT INTO vacuum_db.xxx SELECT * FROM main.xxx;" to copy
149832 /* Copy the triggers, views, and virtual tables from the main database
149847 ** vacuum database and the main database. Assuming no error occurs,
149848 ** both transactions are closed by this block - the main database
149912 ** database. No locks are held on any other files (since the main file
152841 int iTabCur; /* Cursor for the main table */
153958 /* pIdx is a covering index. No need to access the main table. */
154181 ** sub-WHERE clause is to to invoke the main loop body as a subroutine.
154268 /* Invoke the main loop body as a subroutine */
154271 /* Jump here (skipping the main loop body subroutine) if the
159643 ** visiting the rows in the main table. */
162763 ** index rather than the main table. In SQLITE_DEBUG mode, we want
165773 ** 1. The else branch in the main loop is only taken if the row just
165796 ** main loop runs once per group only. And RETURN_ROW, AGGSTEP and AGGINVERSE
166008 ** for the main loop, and for each cursor (start, current and end). */
166160 /* End of the main input loop */
171431 /* The main parser program.
173313 /************** Begin file main.c ********************************************/
173333 /************** Include fts3.h in the middle of main.c ***********************/
173363 /************** Continuing where we left off in main.c ***********************/
173366 /************** Include rtree.h in the middle of main.c **********************/
173400 /************** Continuing where we left off in main.c ***********************/
173403 /************** Include sqliteicu.h in the middle of main.c ******************/
173433 /************** Continuing where we left off in main.c ***********************/
173608 MUTEX_LOGIC( sqlite3_mutex *pMainMtx; ) /* The main static mutex */
175968 ** This function returns true if main-memory should be used instead of
176888 /* The default safety_level for the main database is FULL; for the temp
176891 db->aDb[0].zDbSName = "main";
177477 ** schema cookie in the main database for db, or
177799 ** to the database connection. dbName is the database name (ex: "main" or
177866 ** This test-control queries the seek-counter on the "main" database
178366 /************** End of main.c ************************************************/
179563 int nPrefix; /* Prefix length (0 for main terms index) */
180240 const char *zDb = p->zDb; /* Name of database (e.g. "main", "temp") */
180655 ** always maintain the main "terms" index, but may also maintain one or
180740 const char *zDb, /* Name of db (i.e. "main", "temp" etc.) */
183838 ** It is merged into the main doclist stored in p->doclist.aAll/nAll.
185825 char const *zDb; /* Name of database (e.g. "main") */
190443 ** 64-bit integer level values ("absolute levels"). The main terms index
195266 ** + The index number (0 for the main index, 1 for the first prefix
205212 const char *zDb, /* Name of db ("main", "temp" etc.) */
205333 zDb = "main";
208236 ** wrong moment they might get out of sync. As the main database will be
208739 ** main database.
208948 ** currently being written, or NULL if the main table is currently being
209130 #define RBU_INSERT 1 /* Insert on a main table b-tree */
209131 #define RBU_DELETE 2 /* Delete a row from a main table b-tree */
209136 #define RBU_UPDATE 6 /* Update a row in a main table b-tree */
209194 char zStateDb[5]; /* Db name for state ("stat" or "main") */
209224 rbu_file *pRbuFd; /* Fd for main db of dbRbu */
209240 rbu_file *pMain; /* List of main db files */
209241 rbu_file *pMainRbu; /* List of main db files with pRbu!=0 */
209259 u32 iCookie; /* Cookie value for main db files */
209260 u8 iWriteVer; /* "write-version" value for main db files */
209267 const char *zWal; /* Wal filename for this main db file */
209268 rbu_file *pWalFd; /* Wal file descriptor for this main db */
209805 " FROM main.sqlite_schema "
210087 sqlite3_mprintf("PRAGMA main.index_list = %Q", pIter->zTbl)
210101 sqlite3_mprintf("PRAGMA main.index_xinfo = %Q", zIdx)
210116 /* "PRAGMA index_list" includes the main PK b-tree */
210392 sqlite3_mprintf("PRAGMA main.index_xinfo = %Q", pIter->zIdx)
210514 sqlite3_mprintf("PRAGMA main.index_xinfo = %Q", pIter->zIdx)
210799 sqlite3_mprintf("PRAGMA main.index_list = %Q", pIter->zTbl)
210807 sqlite3_mprintf("PRAGMA main.index_xinfo = %Q", zIdx)
210854 sqlite3_stmt *pXInfo = 0; /* PRAGMA main.index_xinfo = $zIdx */
210873 sqlite3_mprintf("PRAGMA main.index_xinfo = %Q", zIdx)
210894 sqlite3_test_control(SQLITE_TESTCTRL_IMPOSTER, p->dbMain, "main", 1, tnum);
210899 sqlite3_test_control(SQLITE_TESTCTRL_IMPOSTER, p->dbMain, "main", 0, 0);
210912 ** attempts to create any imposter table required to write to the main
210929 sqlite3_test_control(SQLITE_TESTCTRL_IMPOSTER, p->dbMain, "main", 0, 1);
210937 p->dbMain, "main", pIter->zTbl, zCol, 0, &zColl, 0, 0, 0
210959 sqlite3_test_control(SQLITE_TESTCTRL_IMPOSTER, p->dbMain, "main", 1, tnum);
210964 sqlite3_test_control(SQLITE_TESTCTRL_IMPOSTER, p->dbMain, "main", 0, 0);
211162 sqlite3_test_control(SQLITE_TESTCTRL_IMPOSTER, p->dbMain, "main", 0, 1);
211163 sqlite3_test_control(SQLITE_TESTCTRL_IMPOSTER, p->dbMain, "main", 1,tnum);
211168 sqlite3_test_control(SQLITE_TESTCTRL_IMPOSTER, p->dbMain, "main", 0, 0);
211387 ** be used to update the imposter table for the main table b-tree of the
211592 sqlite3_file_control(p->dbRbu, "main", SQLITE_FCNTL_RBUCNT, (void*)p);
211594 const char *zFile = sqlite3_db_filename(p->dbRbu, "main");
211605 memcpy(p->zStateDb, "main", 4);
211652 rc = sqlite3_file_control(p->dbRbu, "main", SQLITE_FCNTL_RBUCNT, (void*)p);
211694 sqlite3_db_filename(p->dbRbu, "main"),
211726 p->rc = sqlite3_file_control(p->dbMain, "main", SQLITE_FCNTL_RBU, (void*)p);
211734 p->rc = sqlite3_file_control(p->dbMain, "main", SQLITE_FCNTL_RBU, (void*)p);
211856 rc2 = sqlite3_exec(p->dbMain, "PRAGMA main.wal_checkpoint=restart", 0, 0,0);
211961 sqlite3_file_control(db, "main", SQLITE_FCNTL_FILE_POINTER, &fd);
212014 const char *zBase = sqlite3_db_filename(p->dbMain, "main");
212020 zMove = sqlite3_db_filename(p->dbRbu, "main");
212291 ** Increment the schema cookie of the main database opened by p->dbMain.
212293 ** Or, if this is an RBU vacuum, set the schema cookie of the main db
212294 ** opened by p->dbMain to one more than the schema cookie of the main
212377 ** "PRAGMA main.$zPragma"
212382 ** "PRAGMA main.$zPragma = $val"
212393 sqlite3_mprintf("PRAGMA main.%s", zPragma)
212396 p->rc = rbuMPrintfExec(p, p->dbMain, "PRAGMA main.%s = %d",
212899 /* Check if the main database is a zipvfs db. If it is, set the upper
212903 int frc = sqlite3_file_control(db, "main", SQLITE_FCNTL_ZIPVFS, 0);
213086 ** Return permyriadage progress indications for the two main stages of
213238 ** 1. Whenever the first page of a main database file is read or
213246 ** to point to the new file. A mutex protected linked list of all main
213250 ** 3. Using a new file-control "SQLITE_FCNTL_RBU", a main db rbu_file
213320 ** Add an item to the main-db lists, if it is not already present.
213322 ** There are two main-db lists. One for all file descriptors, and one
213325 ** main list and is only added to the pDb!=0 list.
213347 ** Remove an item from the main-db lists.
213363 ** either the xOpen() or xAccess() VFS method, search the main-db list for
213873 /* A main database has just been opened. The following block sets
213887 zOpen = sqlite3_db_filename(pDb->pRbu->dbRbu, "main");
213915 ** pointer and, if the file is a main database file, link it into the
215114 ** "main".
215192 ** 0 schema=main, full table scan
215193 ** 1 schema=main, pgno=?1
215220 ** constraint (in which case we use the "main" schema) or else the
215297 ** 0 schema=main, full table scan
215298 ** 1 schema=main, pgno=?1
216510 const char *zDb, /* Name of attached database (e.g. "main") */
217021 /* If this session is attached to a different database ("main", "temp"
217349 const char *zDb, /* Name of db (e.g. "main") */
219386 sessionAppendStr(&buf, "UPDATE main.", &rc);
219493 sessionAppendStr(&buf, "DELETE FROM main.", &rc);
219553 db, "main", zTab, p->nCol, p->azCol, p->abPK, &p->pSelect);
219560 ** INSERT INTO main."zTab" VALUES(?1, ?2, ?3 ...);
219574 sessionAppendStr(&buf, "INSERT INTO main.", &rc);
219609 "INSERT INTO main.sqlite_stat1 VALUES(?1, "
219616 "DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS "
220051 sqlite3 *db, /* Apply change to "main" db of this handle */
220159 ** changeset to the main database attached to handle "db". The supplied
220164 sqlite3 *db, /* Apply change to "main" db of this handle */
220249 db, "main", zNew, &sApply.nCol, &zTab, &sApply.azCol, &sApply.abPK
220358 ** Apply the changeset passed via pChangeset/nChangeset to the main
220362 sqlite3 *db, /* Apply change to "main" db of this handle */
220390 ** Apply the changeset passed via pChangeset/nChangeset to the main database
220395 sqlite3 *db, /* Apply change to "main" db of this handle */
220415 ** Apply the changeset passed via xInput/pIn to the main database
220420 sqlite3 *db, /* Apply change to "main" db of this handle */
220447 sqlite3 *db, /* Apply change to "main" db of this handle */
222112 char *zDb; /* Database holding FTS index (e.g. "main") */
224037 /* The main parser program.
225329 int iIdx; /* Index (main or aPrefix[] entry) */
229053 azConfig[1] = "main";
230031 ** As well as the main term index, there may be up to 31 prefix indexes.
235535 /* Add the entry to the main terms index. */
235580 ** satisfied by scanning multiple terms in the main index.
235584 ** evaluate the prefix query using the main FTS index. This is used
235613 /* Scan multiple terms in the main index */
235974 ** character stored in the main fts index, which will cause the
245779 return sqlite3_key_v2(db, "main", pKey, nKey);
245791 return sqlite3_rekey_v2(db, "main", pKey, nKey);
246162 sql = sqlite3_mprintf("SELECT 'INSERT INTO %s.' || quote(name) || ' SELECT * FROM main.' || quote(name) || ';' FROM main.sqlite_master WHERE type = 'table' AND name!='sqlite_sequence' AND rootpage>0;", dbName);
246182 sql = sqlite3_mprintf("SELECT 'INSERT INTO %s.' || quote(name) || ' SELECT * FROM main.' || quote(name) || ';' FROM %s.sqlite_master WHERE name=='sqlite_sequence';", dbName, dbName);
246192 sql = sqlite3_mprintf("INSERT INTO %s.sqlite_master SELECT type, name, tbl_name, rootpage, sql FROM main.sqlite_master WHERE type='view' OR type='trigger' OR (type='table' AND rootpage=0);", dbName, dbName);