A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://couchbase.github.io/couchbase-lite-core/C/html/group___database.html below:

LiteCore: Databases

CBL_CORE_API bool  c4db_exists (C4String name, C4String inDirectory)   Returns true if a database with the given name exists in the directory.
  NODISCARD CBL_CORE_API C4Databasec4db_openNamed (C4String name, const C4DatabaseConfig2 *config, C4Error *outError)   Opens a database given its name (without the ".cblite2" extension) and directory.
  NODISCARD CBL_CORE_API C4Databasec4db_openAgain (C4Database *db, C4Error *outError)   Opens a new handle to the same database file as db.
  NODISCARD CBL_CORE_API bool  c4db_copyNamed (C4String sourcePath, C4String destinationName, const C4DatabaseConfig2 *config, C4Error *error)   Copies a prebuilt database from the given source path and places it in the destination directory, with the given name.
  NODISCARD CBL_CORE_API bool  c4db_close (C4Database *database, C4Error *outError)   Closes the database.
  NODISCARD CBL_CORE_API bool  c4db_delete (C4Database *database, C4Error *outError)   Closes the database and deletes the file/bundle.
  NODISCARD CBL_CORE_API bool  c4db_deleteNamed (C4String dbName, C4String inDirectory, C4Error *outError)   Deletes the file(s) for the database with the given name in the given directory.
  NODISCARD CBL_CORE_API bool  c4db_rekey (C4Database *database, const C4EncryptionKey *newKey, C4Error *outError)   Changes a database's encryption key (removing encryption if it's NULL.)
  NODISCARD CBL_CORE_API bool  c4_shutdown (C4Error *outError)   Closes down the storage engines.
  ◆ kC4DefaultCollectionName #define kC4DefaultCollectionName   FLSTR("_default") ◆ kC4DefaultCollectionSpec ◆ kC4DefaultScopeID #define kC4DefaultScopeID   FLSTR("_default") ◆ C4DatabaseFlags Enumerator kC4DB_Create 

Create the file if it doesn't exist.

kC4DB_ReadOnly 

Open file read-only.

kC4DB_AutoCompact 

Enable auto-compaction [UNIMPLEMENTED].

kC4DB_VersionVectors 

Upgrade DB to version vectors instead of rev trees.

kC4DB_NoUpgrade 

Disable upgrading an older-version database.

kC4DB_NonObservable 

Disable database/collection observers, for slightly faster writes.

kC4DB_FakeVectorClock 

Use counters instead of timestamps in version vectors (TESTS ONLY)

◆ C4EncryptionAlgorithm Enumerator kC4EncryptionNone 

No encryption (default)

kC4EncryptionAES256 

AES with 256-bit key [ENTERPRISE EDITION ONLY].

◆ C4EncryptionKeySize Enumerator kC4EncryptionKeySizeAES256  ◆ C4MaintenanceType Enumerator kC4Compact 

Shrinks 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).)

kC4Reindex 

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.)

kC4IntegrityCheck 

Checks for database corruption, as might be caused by a damaged filesystem, or memory corruption.

(Runs SQLite PRAGMA integrity_check.)

kC4QuickOptimize 

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.)

kC4FullOptimize 

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.)

◆ c4_enableExtension()

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)

Note
This function is not thread-safe.
Parameters
name The name of the extension (corresponds to the filename without the extension or "lib" prefix) extensionPath The path in which the extension should be found outError On failure, will store the error.
Returns
True on success, false on failure
◆ c4_setExtensionPath() ◆ c4_shutdown()

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.

Note
The caller must use a lock for Database when this function is called.
◆ c4db_close()

Closes the database.

Does not free the handle, although any operation other than c4db_release() will fail with an error.

Note
The caller must use a lock for Database when this function is called.
◆ c4db_copyNamed()

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.

Note
This function is thread-safe.
Parameters
sourcePath The path to the database to be copied. destinationName The name (without filename extension) of the database to create. config Database configuration (including destination directory.) error On failure, error info will be written here.
Returns
True on success, false on failure.
◆ c4db_delete()

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.

Note
This function is thread-safe.
◆ c4db_deleteNamed()

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.

Note
This function is thread-safe.
◆ c4db_endTransaction()

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.

Note
The caller must use a lock for Database when this function is called.
◆ c4db_exists()

Returns true if a database with the given name exists in the directory.

◆ c4db_getConfig2()

Returns the configuration the database was opened with.

Note
This function is thread-safe.
◆ c4db_getDocumentCount()

Returns the number of (undeleted) documents in the database.

Note
The caller must use a lock for Database when this function is called.
◆ c4db_getExtraInfo()

Returns the C4ExtraInfo associated with this db reference.

Note
The caller must use a lock for Database when this function is called.
◆ c4db_getLastSequence()

Returns the latest sequence number allocated to a revision.

Note
The caller must use a lock for Database when this function is called.
◆ c4db_getName()

Returns the name of the database, as given to c4db_openNamed.

This is the filename without the ".cblite2" extension.

Note
This function is thread-safe.
◆ c4db_getPath()

Returns the path of the database.

Note
This function is thread-safe.
◆ c4db_getUUIDs()

Returns the database's public and/or private UUIDs.

(Pass NULL for ones you don't want.)

Note
The caller must use a lock for Database when this function is called.
◆ c4db_isInTransaction()

Is a transaction active?

Note
The caller must use a lock for Database when this function is called.
◆ c4db_maintenance()

Performs database maintenance.

For more detail, see the descriptions of the C4MaintenanceType enum constants.

Note
The caller must use a lock for Database when this function is called.
◆ c4db_nextDocExpiration()

Returns the timestamp at which the next document expiration should take place, or 0 if there are no documents with expiration times.

Note
The caller must use a lock for Database when this function is called.
◆ c4db_openAgain()

Opens a new handle to the same database file as db.

The new connection is completely independent and can be used on another thread.

Note
This function is thread-safe.
◆ c4db_openNamed()

Opens a database given its name (without the ".cblite2" extension) and directory.

Note
This function is thread-safe.
◆ c4db_purgeExpiredDocs()

Purges all documents that have expired.

Note
The caller must use a lock for Database when this function is called.
Warning
This is generally unnecessary, since the background housekeeping task will do it. You might want to call this if you require the purge to happen synchronously, just before copying the database file or something like that.)
Returns
The number of documents purged, or -1 on error.
◆ c4db_rekey()

Changes a database's encryption key (removing encryption if it's NULL.)

Note
The caller must use a lock for Database when this function is called.
All other C4Databases at that path must be closed first or an error will result.
◆ c4db_setExtraInfo()

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.

Note
The caller must use a lock for Database when this function is called.
◆ c4key_setPassword()

Stores a password into a C4EncryptionKey, by using the key-derivation algorithm PBKDF2 to securely convert the password into a raw binary key.

Note
This function is thread-safe.
Parameters
encryptionKey The raw key will be stored here. password The password string. alg The encryption algorithm to use. Must not be kC4EncryptionNone.
Returns
True on success, false on failure
◆ c4key_setPasswordSHA1()

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.

Note
This function is thread-safe.
Parameters
encryptionKey The raw key will be stored here. password The password string. alg The encryption algorithm to use. Must not be kC4EncryptionNone.
Returns
True on success, false on failure
◆ kC4DatabaseFilenameExtension

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