diff options
| author | Jan Tuomi <jan@jantuomi.fi> | 2024-11-09 10:22:31 +0200 |
|---|---|---|
| committer | Jan Tuomi <jan@jantuomi.fi> | 2024-11-09 18:57:45 +0200 |
| commit | 2975980717626b12eb959c1ecd93038b5be1d7c6 (patch) | |
| tree | 5722d65b7bcb3efc2caf8a5f4889048d10d2c96a /README.md | |
| parent | 3087e26f47eb9c5b83d5aec61ca9248856075d8b (diff) | |
Refactor static DB methods to common module
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -59,8 +59,8 @@ let mut db = DB::configure() // Define a record matching the `fields` schema let record = Record { values: vec![ - RecordValue::Int(1), - RecordValue::Bytes(vec![1, 2, 3, 4]), + Value::Int(1), + Value::Bytes(vec![1, 2, 3, 4]), ], }; @@ -68,7 +68,7 @@ let record = Record { db.upsert(&record)?; // Get the record by primary key -let found = db.get(RecordValue::Int(1))?; +let found = db.get(Value::Int(1))?; ``` ## Tests @@ -101,14 +101,14 @@ maturin build --release # for the release version Then you can use the Python bindings like so: ```python -from log_db_py import DB, RecordValue, RecordField, Record +from log_db_py import DB, Value, RecordField, Record config = DB.configure(); config.primary_key = "id" config.fields = [("id", RecordField.int().nullable())] db = config.initialize() -db.upsert(Record(RecordValue.int(10))) +db.upsert(Record(Value.int(10))) ``` ## Copyright and license |
