A connection to a WiredTiger database. More...
Public Member Functions | |
int | close (WT_CONNECTION *connection, const char *config) |
Close a connection. More... | |
int | reconfigure (WT_CONNECTION *connection, const char *config) |
Reconfigure a connection handle. More... | |
const char * | get_home (WT_CONNECTION *connection) |
The home directory of the connection. More... | |
int | configure_method (WT_CONNECTION *connection, const char *method, const char *uri, const char *config, const char *type, const char *check) |
Add configuration options for a method. More... | |
int | is_new (WT_CONNECTION *connection) |
Return if opening this handle created the database. More... | |
Session handles | |
int | open_session (WT_CONNECTION *connection, WT_EVENT_HANDLER *errhandler, const char *config, WT_SESSION **sessionp) |
Open a session. More... | |
Extensions | |
int | load_extension (WT_CONNECTION *connection, const char *path, const char *config) |
Load an extension. More... | |
int | add_data_source (WT_CONNECTION *connection, const char *prefix, WT_DATA_SOURCE *data_source, const char *config) |
Add a custom data source. More... | |
int | add_collator (WT_CONNECTION *connection, const char *name, WT_COLLATOR *collator, const char *config) |
Add a custom collation function. More... | |
int | add_compressor (WT_CONNECTION *connection, const char *name, WT_COMPRESSOR *compressor, const char *config) |
Add a compression function. More... | |
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. More... | |
WT_EXTENSION_API * | get_extension_api (WT_CONNECTION *wt_conn) |
Return a reference to the WiredTiger extension functions. More... | |
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.
See Custom Data Sources for more information.
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.
Note: custom extractors 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. |
int WT_CONNECTION::configure_method | ( | WT_CONNECTION * | connection, |
const char * | method, | ||
const char * | uri, | ||
const char * | config, | ||
const char * | type, | ||
const char * | check | ||
) |
Add configuration options for a method.
See Creating data-specific configuration strings for more information.
connection | the connection handle |
method | the name of the method |
uri | the object type or NULL for all object types |
config | the additional configuration's name and default value |
type | the additional configuration's type (must be one of "boolean"\ , "int" , "list" or "string" ) |
check | the additional configuration check string, or NULL if none |
WT_EXTENSION_API* WT_CONNECTION::get_extension_api | ( | WT_CONNECTION * | wt_conn | ) |
Return a reference to the WiredTiger extension functions.
wt_conn | the WT_CONNECTION handle |
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:
| |||||||
[out] | 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:
|