A connection to a WiredTiger database. More...
Public Member Functions | |
int | close (WT_CONNECTION *connection, const char *config) |
Close a connection. | |
int | reconfigure (WT_CONNECTION *connection, const char *config) |
Reconfigure a connection handle. | |
const char * | get_home (WT_CONNECTION *connection) |
The home directory of the connection. | |
int | is_new (WT_CONNECTION *connection) |
Return if opening this handle created the database. | |
Session handles | |
int | open_session (WT_CONNECTION *connection, WT_EVENT_HANDLER *errhandler, const char *config, WT_SESSION **sessionp) |
Open a session. | |
Extensions | |
int | load_extension (WT_CONNECTION *connection, const char *path, const char *config) |
Load an extension. | |
int | add_data_source (WT_CONNECTION *connection, const char *prefix, WT_DATA_SOURCE *data_source, const char *config) |
Add a custom data source. | |
int | add_collator (WT_CONNECTION *connection, const char *name, WT_COLLATOR *collator, const char *config) |
Add a custom collation function. | |
int | add_compressor (WT_CONNECTION *connection, const char *name, WT_COMPRESSOR *compressor, const char *config) |
Add a compression function. | |
int | add_extractor (WT_CONNECTION *connection, const char *name, WT_EXTRACTOR *extractor, const char *config) |
Add a custom extractor for index keys or column groups. | |
A connection to a WiredTiger database.
The connection may be opened within the same address space as the caller or accessed over a socket connection.
Most applications will open a single connection to a database for each process. The first process to open a connection to a database will access the database in its own address space. Subsequent connections (if allowed) will communicate with the first process over a socket connection to perform their operations.
Thread safety: A WT_CONNECTION handle may be shared between threads, see Multithreading for more information.
int WT_CONNECTION::add_collator | ( | WT_CONNECTION * | connection, |
const char * | name, | ||
WT_COLLATOR * | collator, | ||
const char * | config | ||
) |
Add a custom collation function.
The application must first implement the WT_COLLATOR interface and then register the implementation with WiredTiger:
connection | the connection handle |
name | the name of the collation to be used in calls to WT_SESSION::create |
collator | the application-supplied collation handler |
config | Configuration string, see Configuration Strings. No values currently permitted. |
int WT_CONNECTION::add_compressor | ( | WT_CONNECTION * | connection, |
const char * | name, | ||
WT_COMPRESSOR * | compressor, | ||
const char * | config | ||
) |
Add a compression function.
The application must first implement the WT_COMPRESSOR interface and then register the implementation with WiredTiger:
connection | the connection handle |
name | the name of the compression function to be used in calls to WT_SESSION::create |
compressor | the application-supplied compression handler |
config | Configuration string, see Configuration Strings. No values currently permitted. |
int WT_CONNECTION::add_data_source | ( | WT_CONNECTION * | connection, |
const char * | prefix, | ||
WT_DATA_SOURCE * | data_source, | ||
const char * | config | ||
) |
Add a custom data source.
Not yet supported in WiredTiger.
The application must first implement the WT_DATA_SOURCE interface and then register the implementation with WiredTiger:
connection | the connection handle |
prefix | the URI prefix for this data source, e.g., "file:" |
data_source | the application-supplied implementation of WT_DATA_SOURCE to manage this data source. |
config | Configuration string, see Configuration Strings. No values currently permitted. |
int WT_CONNECTION::add_extractor | ( | WT_CONNECTION * | connection, |
const char * | name, | ||
WT_EXTRACTOR * | extractor, | ||
const char * | config | ||
) |
Add a custom extractor for index keys or column groups.
Not yet supported in WiredTiger.
The application must first implement the WT_EXTRACTOR interface and then register the implementation with WiredTiger:
connection | the connection handle |
name | the name of the extractor to be used in calls to WT_SESSION::create |
extractor | the application-supplied extractor |
config | Configuration string, see Configuration Strings. No values currently permitted. |
int WT_CONNECTION::close | ( | WT_CONNECTION * | connection, |
const char * | config | ||
) |
Close a connection.
Any open sessions will be closed.
connection | the connection handle |
config | Configuration string, see Configuration Strings. No values currently permitted. |
const char* WT_CONNECTION::get_home | ( | WT_CONNECTION * | connection | ) |
The home directory of the connection.
connection | the connection handle |
int WT_CONNECTION::is_new | ( | WT_CONNECTION * | connection | ) |
Return if opening this handle created the database.
connection | the connection handle |
int WT_CONNECTION::load_extension | ( | WT_CONNECTION * | connection, |
const char * | path, | ||
const char * | config | ||
) |
Load an extension.
connection | the connection handle | |||||||||
path | the filename of the extension module | |||||||||
config | Configuration string, see Configuration Strings. Permitted values:
|
int WT_CONNECTION::open_session | ( | WT_CONNECTION * | connection, |
WT_EVENT_HANDLER * | errhandler, | ||
const char * | config, | ||
WT_SESSION ** | sessionp | ||
) |
Open a session.
connection | the connection handle | ||||||
errhandler | An error handler. If NULL , the connection's error handler is used | ||||||
config | Configuration string, see Configuration Strings. Permitted values:
| ||||||
sessionp | the new session handle |
int WT_CONNECTION::reconfigure | ( | WT_CONNECTION * | connection, |
const char * | config | ||
) |
Reconfigure a connection handle.
connection | the connection handle | ||||||||||||||||||
config | Configuration string, see Configuration Strings. Permitted values:
|