aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md16
1 files changed, 13 insertions, 3 deletions
diff --git a/README.md b/README.md
index dd0fdef..b63c4e3 100644
--- a/README.md
+++ b/README.md
@@ -19,6 +19,9 @@ create a new environment handle and open the database at the `path`. returns the
### `lmdb.version()`
returns the LMDB version as `major, minor, patch`.
+### `lmdb.next(db, key)`
+returns the next key-value pair after `key` in the database handle `db`, or the first key-value pair if `key` is `nil`. keys are ordered lexicographically. unlike `next`, this function does not work for traversal if, during traversal, keys are set to `nil`. (TODO: fix this somehow)
+
### `env:txn_begin(write_enabled)`
create a new transaction in the environment. if `write_enabled` is true, then the transaction may make modifications to the database. returns the transaction handle (`txn`) on success.
@@ -32,9 +35,7 @@ flush buffers to disk. if `force` is `true`, a synchronous flush is performed ev
close the environment.
### `txn:open(name, create)`
-open a database in the environment. if multiple databases are to be used in the environment, `name` is the name of the database to open. otherwise, it should not be supplied. if `create` is true, the database is created if it does not exist. returns a database handle on success.
-
-the database handle behaves as a table that may be indexed with string keys and contains string values, read from the database. any changes made will be saved to the database when the transaction is committed.
+open a database in the environment. if multiple databases are to be used in the environment, `name` is the name of the database to open. otherwise, it should not be supplied. if `create` is true, the database is created if it does not exist. returns a database handle (`db`) on success.
### `txn:drop(name)`
delete the database `name` from the environment. (or clear the database, if `name` is not supplied)
@@ -47,3 +48,12 @@ commit all operations of the transaction into the database.
### `txn:txn_begin()`
create a nested transaction in the parent transaction.
+
+### `db[key]`
+read the value of `key` from the database.
+
+### `db[key] = value`
+write `value` as the value of `key` into the database.
+
+### `pairs(db)`
+returns `lmdb.next, db, nil`.