zlmdb._lmdb_vendor.tool¶
Basic tools for working with LMDB.
- copy: Consistent high speed backup an environment.
%prog copy -e source.lmdb target.lmdb
- copyfd: Consistent high speed backup an environment to stdout.
%prog copyfd -e source.lmdb > target.lmdb/data.mdb
- drop: Delete one or more sub-databases.
%prog drop db1
- dump: Dump one or more databases to disk in ‘cdbmake’ format.
Usage: dump [db1=file1.cdbmake db2=file2.cdbmake]
If no databases are given, dumps the main database to ‘main.cdbmake’.
- edit: Add/delete/replace values from a database.
- %prog edit –set key=value –set-file key=/path
–add key=value –add-file key=/path/to/file –delete key
- get: Read one or more values from a database.
%prog get [<key1> [<keyN> [..]]]
- readers: Display readers in the lock table
%prog readers -e /path/to/db [-c]
If -c is specified, clear stale readers.
- restore: Read one or more database from disk in ‘cdbmake’ format.
%prog restore db1=file1.cdbmake db2=file2.cdbmake
The special db name “:main:” may be used to indicate the main DB.
- rewrite: Re-create an environment using MDB_APPEND
%prog rewrite -e src.lmdb -E dst.lmdb [<db1> [<dbN> ..]]
If no databases are given, rewrites only the main database.
shell: Open interactive console with ENV set to the open environment.
stat: Print environment statistics.
warm: Read environment into page cache sequentially.
watch: Show live environment statistics
Attributes¶
Classes¶
Functions¶
|
|
|
|
|
|
|
Given either a Python 2.x or 3.x str, return either a str (Python 2.x) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Return |
|
|
|
|
|
Return a vaguely /usr/bin/xxd formatted representation of the bytestring |
Module Contents¶
- class DiskStatter(path)[source]¶
Bases:
object
- _to_bytes(s)[source]¶
Given either a Python 2.x or 3.x str, return either a str (Python 2.x) or a bytes instance (Python 3.x).