A port of the Node.js library json-file-store

Overview
Comments
  • fix Access denied issue on windows

    fix Access denied issue on windows

    I tried to use single mode in Store configuration, it worked fine on linux but fails on windows with this error

    'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 5, kind: PermissionDenied, message: "Access is denied." }
    

    when investigated found that the issue is rename function which tries to rename a file still oppened. so changed it to be the last call and dropped the values of tem_file and file to close the oppened files and then connect them, also there are some problems in unit testing for windows, specially with multthreading for these methods

    single_save_and_read_multi_threaded
    single_new_multi_threaded
    
    opened by tareksalem 6
  • Q: Is the single file json store mode safe for use through multiple processes at once?

    Q: Is the single file json store mode safe for use through multiple processes at once?

    Thank you for the awesome library!

    I am trying to write a CLI where JFS is used. Users might invoke this CLI in parallel. I can see unit tests for validating multi threaded access, but I couldn't see anything concrete for multi process access.

    question 
    opened by theawless 3
  • Derive debug trait for public structs

    Derive debug trait for public structs

    I think it'll be good to have a default implementation. Without this, users cannot use #[derive(Debug)] on their structs that use JFS as a field. Hence users have to implement debug for the whole struct manually due to just one field.

    Also see:

    • https://rust-lang.github.io/api-guidelines/debuggability.html
    • https://github.com/rust-lang/rust/issues/37009
    • https://www.reddit.com/r/rust/comments/cw88so/derivedebug_is_poor_ergonomics
    opened by theawless 1
  • Generify paths

    Generify paths

    This looks like a great project. I'm looking at using it, thanks for the work.

    I cleaned up a few things in the tests related to where the data is stored. Always put it in target/ so that there's no pollution in the local dir.

    I also generified the constructors so that you can pass in Path based parameters. I need to build some wrappers on the actual DB file, so this was going to be important. Added some docs on those methods too.

    opened by bluejekyll 1
  • Force flush changes to filesystem

    Force flush changes to filesystem

    👋 Thank you for writing JFS! I am using it as an alternative store for a side project. While running my tests, I noticed that my delete case would sporadically fail. It does a bunch of inserts, then a bunch of deletes and then reads to see if they still there.

    I think adding a f.sync_all()? at the end of save_object_to_file should at least alleviate the case.

    I can open a PR if you want.

    bug 
    opened by felipesere 3
Owner
Markus Kohlhase
(flosse = free libre open source software engineering)
Markus Kohlhase
Get JSON values quickly - JSON parser for Rust

get json values quickly GJSON is a Rust crate that provides a fast and simple way to get values from a json document. It has features such as one line

Josh Baker 160 Dec 29, 2022
Rust port of gjson,get JSON value by dotpath syntax

A-JSON Read JSON values quickly - Rust JSON Parser change name to AJSON, see issue Inspiration comes from gjson in golang Installation Add it to your

Chen Jiaju 90 Dec 6, 2022
A node package based on jsonschema-rs for performing JSON schema validation

A node package based on jsonschema-rs for performing JSON schema validation.

dxd 49 Dec 18, 2022
rurl is like curl but with a json configuration file per request

rurl rurl is a curl-like cli tool made in rust, the difference is that it takes its params from a json file so you can have all different requests sav

Bruno Ribeiro da Silva 6 Sep 10, 2022
A rust script to convert a better bibtex json file from Zotero into nice organised notes in Obsidian

Zotero to Obsidian script This is a script that takes a better bibtex JSON file exported by Zotero and generates an organised collection of reference

Sashin Exists 3 Oct 9, 2022
Decode Metaplex mint account metadata into a JSON file.

Simple Metaplex Decoder (WIP) Install From Source Install Rust. curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh Clone the source: git c

Samuel Vanderwaal 8 Aug 25, 2022
Strongly typed JSON library for Rust

Serde JSON   Serde is a framework for serializing and deserializing Rust data structures efficiently and generically. [dependencies] serde_json = "1.0

null 3.6k Jan 5, 2023
JSON Schema validation library

A JSON Schema validator implementation. It compiles schema into a validation tree to have validation as fast as possible.

Dmitry Dygalo 308 Dec 30, 2022
JSON parser which picks up values directly without performing tokenization in Rust

Pikkr JSON parser which picks up values directly without performing tokenization in Rust Abstract Pikkr is a JSON parser which picks up values directl

Pikkr 615 Dec 29, 2022
JSON implementation in Rust

json-rust Parse and serialize JSON with ease. Changelog - Complete Documentation - Cargo - Repository Why? JSON is a very loose format where anything

Maciej Hirsz 500 Dec 21, 2022
A tool for outputs semantic difference of json

jsondiff A tool for outputs semantic difference of json. "semantic" means: sort object key before comparison sort array before comparison (optional, b

niboshi 3 Sep 22, 2021
Easily create dynamic css using json notation

jss! This crate provides an easy way to write dynamic css using json notation. This gives you more convenient than you think. Considering using a dyna

Jovansonlee Cesar 7 May 14, 2022
A fast and simple command-line tool for common operations over JSON-lines files

rjp: Rapid JSON-lines processor A fast and simple command-line tool for common operations over JSON-lines files, such as: converting to and from text

Ales Tamchyna 3 Jul 8, 2022
CLI tool to convert HOCON into valid JSON or YAML written in Rust.

{hocon:vert} CLI Tool to convert HOCON into valid JSON or YAML. Under normal circumstances this is mostly not needed because hocon configs are parsed

Mathias Oertel 23 Jan 6, 2023
Typify - Compile JSON Schema documents into Rust types.

Typify Compile JSON Schema documents into Rust types. This can be used ... via the macro import_types!("types.json") to generate Rust types directly i

Oxide Computer Company 73 Dec 27, 2022
Tools for working with Twitter JSON data

Twitter stream user info extractor This project lets you parse JSON data from the Twitter API or other sources to extract some basic user information,

Travis Brown 4 Apr 21, 2022
A easy and declarative way to test JSON input in Rust.

assert_json A easy and declarative way to test JSON input in Rust. assert_json is a Rust macro heavily inspired by serde json macro. Instead of creati

Charles Vandevoorde 8 Dec 5, 2022
A fast way to minify JSON

COMPACTO (work in progress) A fast way to minify JSON. Usage/Examples # Compress # Input example (~0.11 KB) # { # "id": "123", # "name": "Edua

Eduardo Stuart 4 Feb 27, 2022
Jq - Command-line JSON processor

jq jq is a lightweight and flexible command-line JSON processor. , Unix: , Windows: If you want to learn to use jq, read the documentation at https://

Stephen Dolan 23.9k Jan 4, 2023