Symisc UnQLite

An Embeddable NoSQL Database Engine



UnQLite C/C++ API Reference - Database Engine Handle.

Syntax

int unqlite_close(unqlite *pDb);


Closing a database handle.


Description


The unqlite_close() routine is the destructor for the unqlite handle. Calls to unqlite_close() return UNQLITE_OK if the unqlite object is successfully destroyed and all associated resources are deallocated.


If unqlite_close() is invoked while a transaction is open, the transaction is automatically committed unless the UNQLITE_CONFIG_DISABLE_AUTO_COMMIT option is set. In which case, the database is rolled back.


Parameters


pDb

A pointer to a unQLite Database Handle.


Return value


UNQLITE_OK is returned on success. Any other return value indicates failure such as:


UNQLITE_BUSY: Another thread or process have an exclusive lock on the database. In this case, the caller should wait until the lock holder relinquish it.


UNQLITE_IOERR: OS specific error.


UNQLITE_ABORT: Another thread have released the database handle.


For a human-readable error message, you can extract the database error log via unqlite_config() with a configuration verb set to UNQLITE_CONFIG_ERR_LOG.


See also



unqlite_open, unqlite_config, unqlite_kv_store, unqlite_kv_append, unqlite_compile, unqlite_vm_exec, unqlite_commit, unqlite_rollback.



Symisc Systems
Copyright © Symisc Systems