Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Owez/tinydb
/ functions
Functions
20 in github.com/Owez/tinydb
⨍
Functions
20
◇
Types & classes
3
↓ 10 callers
Method
add_item
Adds a new item to the in-memory database. If this is the first item added to the database, please ensure it's the only type you'd like to add. Due t
src/lib.rs:236
↓ 2 callers
Method
remove_item
Removes an item from the database. See [Database::update_item] if you'd like to update/replace an item easily, rather than individually deleting and
src/lib.rs:268
↓ 1 callers
Method
contains
Searches the database for a specific value. If it does not exist, this method will return [error::DatabaseError::ItemNotFound]. This is a wrapper aro
src/lib.rs:366
↓ 1 callers
Function
db_dump
()
src/lib.rs:447
↓ 1 callers
Method
dump_db
Dumps/saves database to a binary file. # Saving path methods The database will usually save as `\[label\].tinydb` where `\[label\]` is the defined [
src/lib.rs:286
↓ 1 callers
Function
get_stream_from_path
Reads a given path and converts it into a [Vec]<[u8]> stream.
src/lib.rs:393
↓ 1 callers
Method
open_db_path
Opens the path given in [Database::save_path] (or auto-generates a path).
src/lib.rs:371
↓ 1 callers
Method
smart_path_get
Automatically allocates a path for the database if [Database::save_path] is not provided. If it is, this function will simply return it.
src/lib.rs:383
Method
auto_from
Loads database from existant path or creates a new one if it doesn't already exist. This is the recommended way to use TinyDB if you are wanting to e
src/lib.rs:213
Function
auto_from_creation
()
src/lib.rs:546
Function
db_contains
()
src/lib.rs:532
Function
db_from
()
src/lib.rs:519
Method
from
Creates a database from a `.tinydb` file. This retrives a dump file (saved database) from the path given and loads it as the [Database] structure. #
src/lib.rs:169
Method
from
(e: std::io::Error)
src/error.rs:31
Function
item_add
()
src/lib.rs:419
Function
item_remove
()
src/lib.rs:432
Method
new
Creates a new database instance from given parameters. - To add a first item, use [Database::add_item]. - If you'd like to load a dumped database, us
src/lib.rs:121
Method
query_item
Query the database for a specific item. # Syntax ```none self.query_item(|[p]| [p].[field], [query]); ``` - `[p]` The closure (Will be whatever the
src/lib.rs:327
Function
query_item_db
()
src/lib.rs:469
Method
update_item
Replaces an item inside of the database with another item, used for updating/replacing items easily. [Database::query_item] can be used in conjunctio
src/lib.rs:252