Python wrapper around C ::__WT_SESSION. More...
Public Member Functions | |
def | close |
close(self, config) -> int | |
def | open_cursor |
open_cursor(self, uri, to_dup, config) -> int | |
def | create |
create(self, name, config) -> int | |
def | drop |
drop(self, name, config) -> int | |
def | rename |
rename(self, oldname, newname, config) -> int | |
def | salvage |
salvage(self, name, config) -> int | |
def | sync |
sync(self, name, config) -> int | |
def | truncate |
truncate(self, name, start, stop, config) -> int | |
def | upgrade |
upgrade(self, name, config) -> int | |
def | verify |
verify(self, name, config) -> int | |
def | begin_transaction |
begin_transaction(self, config) -> int | |
def | commit_transaction |
commit_transaction(self, config) -> int | |
def | rollback_transaction |
rollback_transaction(self, config) -> int | |
def | checkpoint |
checkpoint(self, config) -> int | |
def | dumpfile |
dumpfile(self, name, config) -> int | |
def | msg_printf |
msg_printf(self, fmt, *args) -> int | |
def | __init__ |
__init__(self) -> Session | |
Public Attributes | |
this |
Python wrapper around C ::__WT_SESSION.
def wiredtiger.Session.begin_transaction | ( | self, | |
args | |||
) |
begin_transaction(self, config) -> int
Start a transaction in this session.
Not yet supported in WiredTiger.
All cursors opened in this session that support transactional semantics will operate in the context of the transaction. The transaction remains active until ended with WT_SESSION::commit_transaction or WT_SESSION::rollback_transaction.
Ignored if a transaction is in progress.
ret = session->begin_transaction(session, NULL);
session | the session handle | |||||||||||||||
config | Configuration string, see Configuration Strings. Permitted values:
|
def wiredtiger.Session.checkpoint | ( | self, | |
args | |||
) |
checkpoint(self, config) -> int
Flush the cache and/or the log and optionally archive log files.
Not yet supported in WiredTiger.
ret = session->checkpoint(session, NULL);
session | the session handle | |||||||||||||||||||||
config | Configuration string, see Configuration Strings. Permitted values:
|
def wiredtiger.Session.close | ( | self, | |
args | |||
) |
close(self, config) -> int
def wiredtiger.Session.commit_transaction | ( | self, | |
args | |||
) |
commit_transaction(self, config) -> int
Commit the current transaction.
Not yet supported in WiredTiger.
Any cursors opened during the transaction will be closed before the commit is processed.
Ignored if no transaction is in progress.
ret = session->commit_transaction(session, NULL);
session | the session handle |
config | Configuration string, see Configuration Strings. No values currently permitted. |
def wiredtiger.Session.create | ( | self, | |
args | |||
) |
create(self, name, config) -> int
Create a table, column group, index or file.
ret = session->create(session, "table:mytable", "key_format=S,value_format=S");
session | the session handle | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
name | the URI of the object to create, such as "table:stock" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
config | Configuration string, see Configuration Strings. Permitted values:
|
def wiredtiger.Session.drop | ( | self, | |
args | |||
) |
drop(self, name, config) -> int
Drop (delete) an object.
ret = session->drop(session, "table:mytable", NULL);
session | the session handle | ||||||
name | the URI of the object to drop, such as "table:stock" | ||||||
config | Configuration string, see Configuration Strings. Permitted values:
|
def wiredtiger.Session.dumpfile | ( | self, | |
args | |||
) |
dumpfile(self, name, config) -> int
Dump a physical file in debugging mode.
The specified file is displayed in a non-portable debugging mode to the application's standard output.
ret = session->dumpfile(session, "file:myfile", NULL);
session | the session handle |
name | the URI of the file to dump |
config | Configuration string, see Configuration Strings. No values currently permitted. |
def wiredtiger.Session.msg_printf | ( | self, | |
args | |||
) |
msg_printf(self, fmt, *args) -> int
Send a string to the message handler for debugging.
ret = session->msg_printf(session, "process pid %lu", mypid);
session | the session handle |
fmt | a printf-like format specification |
def wiredtiger.Session.open_cursor | ( | self, | |
args | |||
) |
open_cursor(self, uri, to_dup, config) -> int
Open a cursor.
Open a new cursor on the specified data source. Cursor handles should be discarded by calling WT_CURSOR::close.
Cursors are light-weight objects but may hold references to heavier-weight objects. Applications should usually not cache cursors as a performance optimization, instead, a new cursor should be opened for new groups of operations.
Cursors are opened in the context of the current transaction. The cursor must be closed before the transaction can end. If WT_SESSION::commit_transaction or WT_SESSION::rollback_transaction are called with cursors open in the transaction, the cursor handles will be closed implicitly and must not be accessed again.
An existing cursor can be duplicated by passing it as the to_dup
parameter and setting the uri
parameter to NULL
, otherwise the to_dup
parameter should be NULL
.
ret = session->open_cursor( session, "table:mytable", NULL, NULL, &cursor);
session | the session handle | |||||||||||||||||||||||||||
uri | the data source on which the cursor operates; cursors are usually opened on tables, however, cursors can be opened on any data source, regardless of whether it is ultimately stored in a table. Some cursor types may have limited functionality (for example, be read-only or not support transactional updates). See Cursor types for more information. The following are the builtin cursor types:
| |||||||||||||||||||||||||||
to_dup | a cursor to duplicate | |||||||||||||||||||||||||||
session | the session handle | |||||||||||||||||||||||||||
config | Configuration string, see Configuration Strings. Permitted values:
| |||||||||||||||||||||||||||
cursorp | a pointer to the newly opened cursor |
def wiredtiger.Session.rename | ( | self, | |
args | |||
) |
rename(self, oldname, newname, config) -> int
Rename an object.
ret = session->rename(session, "table:old", "table:new", NULL);
session | the session handle |
oldname | the current URI of the object, such as "table:old" |
newname | the new name of the object, such as "table:new" |
config | Configuration string, see Configuration Strings. No values currently permitted. |
def wiredtiger.Session.rollback_transaction | ( | self, | |
args | |||
) |
rollback_transaction(self, config) -> int
Roll back the current transaction.
Not yet supported in WiredTiger.
Any cursors opened during the transaction will be closed before the rollback is processed.
Ignored if no transaction is in progress.
ret = session->rollback_transaction(session, NULL);
session | the session handle |
config | Configuration string, see Configuration Strings. No values currently permitted. |
def wiredtiger.Session.salvage | ( | self, | |
args | |||
) |
salvage(self, name, config) -> int
Salvage a file or table.
Salvage rebuilds the file, or files of which a table is comprised, discarding any corrupted file blocks.
Previously deleted records may re-appear, and inserted records may disappear, when salvage is done, so salvage should not be run unless it is known to be necessary. Normally, salvage should be called after a file or table has been corrupted, as reported by the WT_SESSION::verify method.
Files are rebuilt in place, the salvage method overwrites the existing files.
ret = session->salvage(session, "table:mytable", NULL);
session | the session handle | ||||||
name | the URI of the file or table to salvage | ||||||
config | Configuration string, see Configuration Strings. Permitted values:
|
def wiredtiger.Session.sync | ( | self, | |
args | |||
) |
sync(self, name, config) -> int
Sync a file or table.
Flush dirty pages from a table to stable storage. Note that not all pages are necessarily flushed (pages pinned in memory, or in use by other threads of control may not be written until all open session handles for the table are closed).
ret = session->sync(session, "table:mytable", NULL);
session | the session handle |
name | the URI of the file or table to sync |
config | Configuration string, see Configuration Strings. No values currently permitted. |
def wiredtiger.Session.truncate | ( | self, | |
args | |||
) |
truncate(self, name, start, stop, config) -> int
Truncate a file, table or a cursor range.
ret = session->truncate(session, "table:mytable", NULL, NULL, NULL);
WT_CURSOR *start, *stop; ret = session->open_cursor( session, "table:mytable", NULL, NULL, &start); start->set_key(start, "June01"); ret = start->search(start); ret = session->open_cursor( session, "table:mytable", NULL, NULL, &stop); stop->set_key(stop, "June30"); ret = stop->search(stop); ret = session->truncate(session, NULL, start, stop, NULL);
session | the session handle |
name | the URI of the file or table to truncate |
start | optional cursor marking the first record discarded; if NULL , the truncate starts from the beginning of the table |
stop | optional cursor marking the last record discarded; if NULL , the truncate continues to the end of the table |
config | Configuration string, see Configuration Strings. No values currently permitted. |
def wiredtiger.Session.upgrade | ( | self, | |
args | |||
) |
upgrade(self, name, config) -> int
Upgrade a file or table.
Upgrade upgrades a file, or the files of which a table is comprised.
ret = session->upgrade(session, "table:mytable", NULL);
session | the session handle |
name | the URI of the file or table to upgrade |
config | Configuration string, see Configuration Strings. No values currently permitted. |
def wiredtiger.Session.verify | ( | self, | |
args | |||
) |
verify(self, name, config) -> int
Verify a file or table.
Verify reports if a file, or the files of which a table is comprised, have been corrupted. The WT_SESSION::salvage method can be used to repair a corrupted file,
ret = session->verify(session, "table:mytable", NULL);
session | the session handle |
name | the URI of the file or table to verify |
config | Configuration string, see Configuration Strings. No values currently permitted. |