db
.
Create the file if it doesn't exist.
kC4DB_ReadOnlyOpen file read-only.
kC4DB_AutoCompactEnable auto-compaction [UNIMPLEMENTED].
kC4DB_VersionVectorsUpgrade DB to version vectors instead of rev trees.
kC4DB_NoUpgradeDisable upgrading an older-version database.
kC4DB_NonObservableDisable database/collection observers, for slightly faster writes.
kC4DB_FakeVectorClockUse counters instead of timestamps in version vectors (TESTS ONLY)
◆ C4EncryptionAlgorithm Enumerator kC4EncryptionNoneNo encryption (default)
kC4EncryptionAES256AES with 256-bit key [ENTERPRISE EDITION ONLY].
◆ C4EncryptionKeySize Enumerator kC4EncryptionKeySizeAES256 ◆ C4MaintenanceType Enumerator kC4CompactShrinks the database file by removing any empty pages, and deletes blobs that are no longer referenced by any documents.
(Runs SQLite PRAGMA incremental_vacuum; PRAGMA wal_checkpoint(TRUNCATE)
.)
Rebuilds indexes from scratch.
Normally never needed, but can be used to help diagnose/troubleshoot cases of database corruption if only indexes are affected. (Runs SQLite REINDEX
.)
Checks for database corruption, as might be caused by a damaged filesystem, or memory corruption.
(Runs SQLite PRAGMA integrity_check
.)
Quickly updates database statistics that may help optimize queries that have been run by this Database since it was opened.
The more queries that have been run, the more effective this will be, but it tries to do its work quickly by scanning only portions of indexes. This operation is also performed automatically by c4db_close. (Runs SQLite PRAGMA analysis_limit=400; PRAGMA optimize
.)
Fully scans all indexes to gather database statistics that help optimize queries.
This may take some time, depending on the size of the indexes, but it doesn't have to be redone unless the database changes drastically, or new indexes are created. (Runs SQLite PRAGMA analysis_limit=0; ANALYZE
.)
Asks LiteCore to look for and validate the presence of an extension given the name of the extension and the path in which it is supposed to reside.
It makes an attempt to only check things that have the possibility of being corrected by the user (i.e. if there is a bug in the extension and it cannot load functionally that won't be caught)
Closes down the storage engines.
Must close all databases first. You don't generally need to do this, but it can be useful in tests.
◆ c4db_beginTransaction()Begins a transaction.
Transactions can nest; only the first call actually creates a database transaction.
Closes the database.
Does not free the handle, although any operation other than c4db_release() will fail with an error.
Copies a prebuilt database from the given source path and places it in the destination directory, with the given name.
If a database already exists there, it will be overwritten. However if there is a failure, the original database will be restored as if nothing happened.
Closes the database and deletes the file/bundle.
Does not free the handle, although any operation other than c4db_release() will fail with an error. All C4Databases at that path must be closed first or an error will result.
Deletes the file(s) for the database with the given name in the given directory.
All C4Databases at that path must be closed first or an error will result. Returns false, with no error, if the database doesn't exist.
Commits or aborts a transaction.
If there have been multiple calls to beginTransaction, it takes the same number of calls to endTransaction to actually end the transaction; only the last one commits or aborts the database transaction.
Returns true if a database with the given name exists in the directory.
◆ c4db_getConfig2()Returns the configuration the database was opened with.
Returns the number of (undeleted) documents in the database.
Returns the C4ExtraInfo associated with this db reference.
Returns the latest sequence number allocated to a revision.
Returns the name of the database, as given to c4db_openNamed
.
This is the filename without the ".cblite2" extension.
Returns the path of the database.
Returns the database's public and/or private UUIDs.
(Pass NULL for ones you don't want.)
Is a transaction active?
Performs database maintenance.
For more detail, see the descriptions of the C4MaintenanceType enum constants.
Returns the timestamp at which the next document expiration should take place, or 0 if there are no documents with expiration times.
Opens a new handle to the same database file as db
.
The new connection is completely independent and can be used on another thread.
Opens a database given its name (without the ".cblite2" extension) and directory.
Purges all documents that have expired.
Changes a database's encryption key (removing encryption if it's NULL.)
Associates an arbitrary pointer with this database instance, for client use.
For example, this could be a reference to the higher-level object wrapping the database.
The destructor
field of the C4ExtraInfo
can be used to provide a function that will be called when the C4Database is freed, so it can free any resources associated with the pointer.
Stores a password into a C4EncryptionKey, by using the key-derivation algorithm PBKDF2 to securely convert the password into a raw binary key.
Stores a password into a C4EncryptionKey, by using the key-derivation algorithm PBKDF2 to securely convert the password into a raw binary key.
Uses SHA1 for the hashing function as employed by PBKDF2.
Filename extension of databases – ".cblite2".
Includes the period.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4