Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

PickleDB-rs is a lightweight and simple key-value store. It is a Rust version for Python's PickleDB

License

NotificationsYou must be signed in to change notification settings

seladb/pickledb-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust testRust auditCrateAPI

PickleDB is a lightweight and simple key-value store written in Rust, heavily inspired byPython's PickleDB

PickleDB is fun and easy to use

use pickledb::{PickleDb,PickleDbDumpPolicy,SerializationMethod};fnmain(){// create a new DB with AutoDump (meaning every change is written to the file)// and with Json serialization (meaning DB will be dumped to file as a Json object)letmut db =PickleDb::new("example.db",PickleDbDumpPolicy::AutoDump,SerializationMethod::Json);// set the value 100 to the key 'key1'    db.set("key1",&100).unwrap();// print the value of key1println!("The value of key1 is: {}", db.get::<i32>("key1").unwrap());// load the DB from the same filelet db2 =PickleDb::load("example.db",PickleDbDumpPolicy::DumpUponRequest,SerializationMethod::Json).unwrap();// print the value of key1println!("The value of key1 as loaded from file is: {}", db2.get::<i32>("key1").unwrap());}

Installation

This crate works with Cargo and can be found incrates.ioAdd this to yourCargo.toml:

[dependencies]pickledb ="0.5.1"

Documentation

All documentation for this crate can be found indocs.rs

Examples

There are currently two examples shipped with PickleDB:

  • Hello World which shows the basic usage of PickleDB:create a new DB, load a DB from file, get/set key-value pairs of different types, and more
  • Lists which shows how to use lists in PickleDB:create new lists, add/remove items from lists, retrieve items from lists, remove lists, and more

Changelog

Version 0.5.1

  • Bugfix: Add missing JSON feature gate

Version 0.5.0

  • Turn on/off file formats with features
  • DumpUponRequest policy no longer dumps onDrop
  • (internal) Switch CI from TravisCI to GitHub Actions

Version 0.4.1

  • Bump up dependencies versions to fix vulnerabilities found in few of them

Version 0.4.0

  • Changed all doc tests fromignore tono_run so generated docs don't contain untested warnings
  • Changed both instances oflextend to take iterators of references rather than a slice of values
  • Fixed bug inload_test()
  • Fixed rustfmt and clippy warnings
  • Added examples toCargo.toml to allow them to be run via Cargo

Version 0.3.0

  • Added new serialization options. Now PickleDB supportsJSON,Bincode,YAML andCBOR serializations
  • Added proper error handling (Issue #3)
  • UsePath andPathBuf instead of strings to describe DB paths
  • Better organization of the code

Version 0.2.0

About

PickleDB-rs is a lightweight and simple key-value store. It is a Rust version for Python's PickleDB

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors7

Languages


[8]ページ先頭

©2009-2025 Movatter.jp