rust database for you to use and help me make!

Overview

Welcome To Rust Database!

What is this?

this is a database for you to git clone and use in your project!

Why should i use it?

It is fast and it takes 2ms to return data. Also if you want to local store data on your pc of your users then you may want to use it.

Start the online database

use rust_store;

fn main() {
    rust_store::StateData {
        api_key: "your_api_key".to_string(),
        // make sure to change this to some key!
        // change this if your want but otherwise don't
        null: "null_nil_value_key:345n,234lj52".to_string(),
        // make sure this file exists or the code will not work!
        data_storage_location: "database/".to_string(),
    }
    .start_database_online()
}

What requests can you do?

=> GET / (index)
=> GET /read/<path>/<api_key> (read)
=> GET /add/<path>/<data_name>/<data>/<api_key> (add)
=> GET /delete/<path>/<api_key> (delete)
=> GET /null_write/<path>/<api_key> (null_write)

How can you use it?

USE RUST NIGHTLY!!!!!!!

use ` instead of / to navgate directories.

This request will add data at ${your_database_folder}/test/worked data.txt. The data.txt will have "this is going very well" stored.

http://localhost:8000/add/test`worked/data/this is going very well/your_api_key

This request will delete at ${your_database_folder}/test/worked data.txt.

http://localhost:8000/delete/test`worked`data/your_api_key

This request will read data at ${your_database_folder}/test/worked data.txt.

http://localhost:8000/read/test`worked`data/your_api_key

This request will write null at ${your_database_folder}/test/worked data.txt.

http://localhost:8000/null_write/test`worked`data/your_api_key

Info on api

http://localhost:8000/

Local Host Functions

To use this you don't need to start the database.

To write

use rust_store;

fn main(){
    let func = rust_store::StateData {
            api_key: "your_api_key".to_string(),
            null: "null_nil_value_key:345n,234lj52".to_string(),
            data_storage_location: "database/".to_string(),
        };
        func.write_data("this is going very well", "test/worked/local", "data")
            .expect("failed when writing data");
}

To read

use rust_store;

fn main(){
     let func = rust_store::StateData {
            api_key: "your_api_key".to_string(),
            null: "null_nil_value_key:345n,234lj52".to_string(),
            data_storage_location: "database/".to_string(),
        };
        let check_data = func
            .read_data("test/worked/local/data")
            .expect("failed when reading");
}

To Delete

use rust_store;

fn main(){
     let func = rust_store::StateData {
            api_key: "your_api_key".to_string(),
            null: "null_nil_value_key:345n,234lj52".to_string(),
            data_storage_location: "database/".to_string(),
        };
        func.delete_data("test/worked/local/data")
            .expect("delete failed");
}

To write null

use rust_store;

fn main(){
     let func = rust_store::StateData {
            api_key: "your_api_key".to_string(),
            null: "null_nil_value_key:345n,234lj52".to_string(),
            data_storage_location: "database/".to_string(),
        };
        func.null_write("test/worked/local/data")
            .expect("write null functions failed");
}

Questions?

How Does this database write data?

This database uses txt instead of csv or json because txt is the fastest way to read and write data.

How Does it organize data?

This database uses a directory way just like you would do on a computer. This storage method automatically make files for you too!

How Does it read data?

This database requires your to put a directory (if you want to use a "/" use a "`" instead) and it return txt value by reading it line by line (a vec value).

How does this database value handle null?

This database has a write null feature to write a null key. If the null key is read when your read a txt it returns

{
    "data" : "null"
    "error" : "data is null"
}

make sure to handle error and check if error value equals "Success".

Error Handling?

If the database work just as planned it returns

{
    "error" : "Success"
}

otherwise it shows the error it received like this.

{
    "error" : "error when writing data"
}

For local functions is returns a Result<(), String> and the errors are the same just make sure to handle the error by matching the string.

Still have questions?

Dm me in discord at Carghai88#1468

Pull Requests?

I will respond as fast as possible just make sure it follows my ideology of speed!

You might also like...
This project contains small exercises to get you used to reading and writing Rust code
This project contains small exercises to get you used to reading and writing Rust code

rustlings 歹 Greetings and welcome to rustlings. This project contains small exercises to get you used to reading and writing Rust code. This inclu

Cogo is a high-performance library for programming stackful coroutines with which you can easily develop and maintain massive concurrent programs.
Cogo is a high-performance library for programming stackful coroutines with which you can easily develop and maintain massive concurrent programs.

Cogo is a high-performance library for programming stackful coroutines with which you can easily develop and maintain massive concurrent programs.

Goodname is a tool to assist you with cool naming of your methods and software

Goodname is a tool to assist you with cool naming of your methods and software. Given a brief description of your method or software, this tool enumerates name candidates forming subsequences of the description (i.e., abbreviation).

Rust library for hardware accelerated drawing of 2D shapes, images, and text, with an easy to use API.
Rust library for hardware accelerated drawing of 2D shapes, images, and text, with an easy to use API.

Speedy2D Hardware-accelerated drawing of shapes, images, and text, with an easy to use API. Speedy2D aims to be: The simplest Rust API for creating a

Rust app that creates cli quiz for you!

quizer rust app that creates cli quiz for you! Installation Download binary release or build from source using cargo Make binary executable chmod +x /

A tool to use docker / podman / oci containers with rust

contain-rs A tool to use docker / podman / oci containers with rust TODO improve error types improve error reporting handle std error for child proces

Game development practices with Rust programming language. I want to use different crates for this.

Haz覺r Oyun Motorlar覺n覺 Kullanarak Rust Dili Yard覺m覺yla Oyunlar Gelitirmek Rust programlama dilinde oyun gelitirmek i癟in pop羹ler birka癟 haz覺r 癟at覺y覺

Demonstration of how to use the rust object_store crate

Introduction Demonstration of how to use the Rust object_store crate Example

Small, clean, easy to use programming language

Thistle A modern, simplistic multi-paradigm language supporting object-oriented features Hello World! import IO object Main def main(): unit

Releases(0.2.4)
Owner
Carghai74
I'm a swift, dart, HTML5, CSS, python, elixir, C#, C++, and ruby dev who mainly does mobile development. I also won 2022 Hills hacks 1st place.
Carghai74
Make and use playgrounds locally.

cargo playground Cargo playground opens a local playground in the editor of your choice. Install You can install it directly using cargo $ cargo insta

null 17 Aug 5, 2021
A tray application for Windows that gives you push notifications and instant downloads of new posts, messages and stories posted by models you subscribe to on Onlyfans.

OF-notifier A tray application for Windows that gives you push notifications and instant downloads of new posts, messages and stories posted by models

Gentlemen Mercenary 6 Sep 13, 2022
A webapp that reads your articles to you while you're on the subway

ReadToMyShoe Video Demo A website that reads articles to you, even when you're offline. Still in early development. This is a full-stack Rust webapp,

Michael Rosenberg 18 Sep 15, 2022
A tool to make grocery lists written in Rust

grusterylist: makes grocery lists, written in Rust grusterylist uses and can add to local libraries of user-added recipes and grocery items to put tog

null 3 Jun 17, 2022
Make a .scratch directory to keep random scribbles in

mkscratch Creates a directory named .scratch in your current working directory which will be ignored by Git. Useful for keeping around miscellaneous f

Kayla 2 Feb 20, 2022
A webring of people who make cool stuff. technology, music, art, writing, anything goes!

a webring of people who make cool stuff. technology, music, art, writing, anything goes!

Kognise 41 Aug 24, 2022
Build database expression type checker and vectorized runtime executor in type-safe Rust

Typed Type Exercise in Rust Build database expression type checker and vectorized runtime executor in type-safe Rust. This project is highly inspired

Andy Lok 86 Aug 29, 2022
In this repository you can find modules with code and comments that explain rust syntax and all about Rust lang.

Learn Rust What is this? In this repository you can find modules with code and comments that explain rust syntax and all about Rust lang. This is usef

Domagoj Ratko 3 Sep 2, 2022
TypeRust - simple Rust playground where you can build or run your Rust code and share it with others

Rust playground Welcome to TypeRust! This is a simple Rust playground where you can build or run your Rust code and share it with others. There are a

Kirill Vasiltsov 30 Aug 1, 2022
:crab: Small exercises to get you used to reading and writing Rust code!

rustlings ?? 歹 Greetings and welcome to rustlings. This project contains small exercises to get you used to reading and writing Rust code. This inclu

The Rust Programming Language 30.1k Sep 28, 2022