Home

Awesome

<pre align="center"> Built by @KipData ███████╗███╗ ██╗ ██████╗██╗ ██╗ ███████╗ ██████╗ ██╗ ██╔════╝████╗ ██║██╔════╝██║ ██╔╝ ██╔════╝██╔═══██╗██║ █████╗ ██╔██╗ ██║██║ █████╔╝ ███████╗██║ ██║██║ ██╔══╝ ██║╚██╗██║██║ ██╔═██╗ ╚════██║██║▄▄ ██║██║ ██║ ██║ ╚████║╚██████╗██║ ██╗ ███████║╚██████╔╝███████╗ ╚═╝ ╚═╝ ╚═══╝ ╚═════╝╚═╝ ╚═╝ ╚══════╝ ╚══▀▀═╝ ╚══════╝ ----------------------------------- 🖕 </pre> <h3 align="center"> Lightweight DBMS </h3> <p align="center"> <a href="https://summer-ospp.ac.cn/org/orgdetail/0b09d23d-2510-4537-aa9d-45158bb6bdc2"><img src="https://img.shields.io/badge/OSPP-KipData-3DA639?logo=opensourceinitiative"></a> <a href="https://github.com/KipData/KipSQL/blob/main/LICENSE"><img src="https://img.shields.io/github/license/KipData/KipSQL"></a> &nbsp; <a href="https://www.rust-lang.org/community"><img src="https://img.shields.io/badge/Rust_Community%20-Join_us-brightgreen?style=plastic&logo=rust"></a> </p> <p align="center"> <a href="https://github.com/KipData/KipSQL/actions/workflows/ci.yml"><img src="https://github.com/KipData/KipSQL/actions/workflows/ci.yml/badge.svg" alt="CI"></img></a> <a href="https://crates.io/crates/fnck_sql/"><img src="https://img.shields.io/crates/v/fnck_sql.svg"></a> <a href="https://hub.docker.com/r/kould23333/fncksql"><img src="https://img.shields.io/badge/Docker-fncksql-2496ED?logo=docker"></a> </p> <p align="center"> <a href="https://github.com/KipData/KipSQL" target="_blank"> <img src="https://img.shields.io/github/stars/KipData/KipSQL.svg?style=social" alt="github star"/> <img src="https://img.shields.io/github/forks/KipData/KipSQL.svg?style=social" alt="github fork"/> </a> </p>

What is FnckSQL

FnckSQL individual developers independently implemented LSM KV-based SQL DBMS out of hobby. This SQL database will prove to you that anyone can write a database (even the core author cannot find a job). If you are also a database-related Enthusiastic, let us give this "beautiful" industry a middle finger🖕.

Welcome to our WebSite, Power By FnckSQL: http://www.kipdata.site/

Quick Started

Tips: Install rust toolchain first.

Clone the repository

git clone https://github.com/KipData/FnckSQL.git

start then use psql to enter sql pg Using FnckSQL in code

let fnck_sql = DataBaseBuilder::path("./data")
    .build()
    .await?;
let tuples = fnck_sql.run("select * from t1").await?;

Storage Support:

Docker

Pull Image

docker pull kould23333/fncksql:latest

Build From Source

git clone https://github.com/KipData/FnckSQL.git
cd FnckSQL
docker build -t kould23333/fncksql:latest .

Run

We installed the psql tool in the image for easy debug.

You can use psql -h 127.0.0.1 -p 5432 to do this.

docker run -d \
--name=fncksql \
-p 5432:5432 \
--restart=always \
-v fncksql-data:/fnck_sql/fncksql_data \
-v /etc/localtime:/etc/localtime:ro \
kould23333/fncksql:latest

Features

#[derive(Default, Debug, PartialEq)]
struct MyStruct {
  c1: i32,
  c2: String,
}

implement_from_tuple!(
    MyStruct, (
        c1: i32 => |inner: &mut MyStruct, value| {
            if let DataValue::Int32(Some(val)) = value {
                inner.c1 = val;
            }
        },
        c2: String => |inner: &mut MyStruct, value| {
            if let DataValue::Utf8(Some(val)) = value {
                inner.c2 = val;
            }
        }
    )
);
function!(TestFunction::test(LogicalType::Integer, LogicalType::Integer) -> LogicalType::Integer => |v1: ValueRef, v2: ValueRef| {
    let plus_binary_evaluator = EvaluatorFactory::binary_create(LogicalType::Integer, BinaryOperator::Plus)?;
    let value = plus_binary_evaluator.binary_eval(&v1, &v2);

    let plus_unary_evaluator = EvaluatorFactory::unary_create(LogicalType::Integer, UnaryOperator::Minus)?;
    Ok(plus_unary_evaluator.unary_eval(&value))
});

let fnck_sql = DataBaseBuilder::path("./data")
    .register_function(TestFunction::new())
    .build()
    .await?;

Roadmap

License

FnckSQL uses the Apache 2.0 license to strike a balance between open contributions and allowing you to use the software however you want.

Contributors

Thanks For