Skip to content

Commit

Permalink
Rename: KipSQL -> FnckSQL (#119)
Browse files Browse the repository at this point in the history
* docs: KipSQL -> FnckSQL

* docs: KipSQL -> FnckSQL

* code fmt
  • Loading branch information
KKould authored Jan 28, 2024
1 parent ed4c7ee commit 01b3e6b
Show file tree
Hide file tree
Showing 12 changed files with 129 additions and 121 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[package]
name = "kip-sql"
name = "fnck_sql"
version = "0.0.1-alpha.9"
edition = "2021"
authors = ["Kould <[email protected]>", "Xwg <[email protected]>"]
description = "build the SQL layer of KipDB database"
description = "Fast Insert OLTP SQL DBMS"
license = "Apache-2.0"
repository = "https://github.com/KipData/KipSQL"
readme = "README.md"
Expand Down
54 changes: 28 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
<pre align="center">
Built by @KipData

██╗ ██╗██╗██████╗ ███████╗ ██████╗ ██╗
██║ ██╔╝██║██╔══██╗██╔════╝██╔═══██╗██║
█████╔╝ ██║██████╔╝███████╗██║ ██║██║
██╔═██╗ ██║██╔═══╝ ╚════██║██║▄▄ ██║██║
██║ ██╗██║██║ ███████║╚██████╔╝███████╗
╚═╝ ╚═╝╚═╝╚═╝ ╚══════╝ ╚══▀▀═╝ ╚══════╝

███████╗███╗ ██╗ ██████╗██╗ ██╗ ███████╗ ██████╗ ██╗
██╔════╝████╗ ██║██╔════╝██║ ██╔╝ ██╔════╝██╔═══██╗██║
█████╗ ██╔██╗ ██║██║ █████╔╝ ███████╗██║ ██║██║
██╔══╝ ██║╚██╗██║██║ ██╔═██╗ ╚════██║██║▄▄ ██║██║
██║ ██║ ╚████║╚██████╗██║ ██╗ ███████║╚██████╔╝███████╗
╚═╝ ╚═╝ ╚═══╝ ╚═════╝╚═╝ ╚═╝ ╚══════╝ ╚══▀▀═╝ ╚══════╝

-----------------------------------
Embedded SQL DBMS
🖕
</pre>
<h3 align="center">
The Lightweight Embedded OLTP Open-source Database
Lightweight DBMS
</h3>

<p align="center">
Expand All @@ -29,17 +31,16 @@ Embedded SQL DBMS
</a>
</p>

### What is KipSQL
### What is FnckSQL

KipSQL is designed to allow small Rust projects to reduce external dependencies and get rid of heavy database maintenance,
so that the Rust application itself can provide SQL storage capabilities.
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 KipSQL: **http://www.kipdata.site/**
Welcome to our WebSite, Power By FnckSQL: **http://www.kipdata.site/**

### Quick Started
Clone the repository
``` shell
git clone https://github.com/KipData/KipSQL.git
git clone https://github.com/KipData/fncksql.git
```

Install rust toolchain first.
Expand All @@ -50,7 +51,7 @@ Example
```sql
create table blog (id int primary key, title varchar unique);

insert into blog (id, title) values (0, 'KipSQL'), (1, 'KipDB'), (2, 'KipBlog');
insert into blog (id, title) values (0, 'FnckSQL'), (1, 'KipDB');

update blog set title = 'KipData' where id = 2;

Expand All @@ -64,9 +65,9 @@ truncate table blog;

drop table blog;
```
Using KipSQL in code
Using FnckSQL in code
```rust
let kipsql = Database::with_kipdb("./data").await?;
let fnck_sql = Database::with_kipdb("./data").await?;

let tupes = db.run("select * from t1").await?;
```
Expand Down Expand Up @@ -105,18 +106,14 @@ implement_from_tuple!(
- Codegen on LuaJIT: `features = ["codegen_execute"]`
- MVCC Transaction
- Optimistic
- SQL field options
- not null
- null
- Field options
- [not] null
- unique
- primary key
- SQL where options
- is null
- is not null
- like
- not like
- in
- not in
- is [not] null
- [not] like
- [not] in
- Supports index type
- Unique Index
- Supports multiple primary key types
Expand All @@ -128,7 +125,12 @@ implement_from_tuple!(
- UInteger
- Bigint
- UBigint
- Float
- Double
- Varchar
- Date
- DateTime
- Decimal
- DDL
- Create
- [x] Table
Expand Down Expand Up @@ -177,7 +179,7 @@ implement_from_tuple!(

## License

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

[1]: <https://github.com/KipData/KipSQL/blob/main/LICENSE>
Expand Down
26 changes: 14 additions & 12 deletions benchmarks/query_benchmark.rs
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
use criterion::{criterion_group, criterion_main, Criterion};
use fnck_sql::db::{Database, DatabaseError};
use fnck_sql::execution::volcano;
use fnck_sql::storage::kip::KipStorage;
use fnck_sql::storage::Storage;
use indicatif::{ProgressBar, ProgressStyle};
use itertools::Itertools;
use kip_sql::db::{Database, DatabaseError};
use kip_sql::execution::volcano;
use kip_sql::storage::kip::KipStorage;
use kip_sql::storage::Storage;
use sqlite::Error;
use std::cell::RefCell;
use std::fs;
use std::path::Path;
use std::sync::Arc;

const QUERY_CASE: &'static str = "select * from t1 where c1 = 1000";
const QUERY_BENCH_KIPSQL_PATH: &'static str = "./kipsql_bench";
const QUERY_BENCH_FNCK_SQL_PATH: &'static str = "./fncksql_bench";
const QUERY_BENCH_SQLITE_PATH: &'static str = "./sqlite_bench";
const TABLE_ROW_NUM: u64 = 2_00_000;

async fn init_kipsql_query_bench() -> Result<(), DatabaseError> {
let database = Database::with_kipdb(QUERY_BENCH_KIPSQL_PATH).await.unwrap();
async fn init_fncksql_query_bench() -> Result<(), DatabaseError> {
let database = Database::with_kipdb(QUERY_BENCH_FNCK_SQL_PATH)
.await
.unwrap();
database
.run("create table t1 (c1 int primary key, c2 int)")
.await?;
Expand Down Expand Up @@ -84,16 +86,16 @@ fn query_on_execute(c: &mut Criterion) {

init_sqlite_query_bench().unwrap();
}
if !path_exists_and_is_directory(QUERY_BENCH_KIPSQL_PATH) {
if !path_exists_and_is_directory(QUERY_BENCH_FNCK_SQL_PATH) {
println!(
"KipSQL: The table is not initialized and data insertion is started. => {}",
"FnckSQL: The table is not initialized and data insertion is started. => {}",
TABLE_ROW_NUM
);

init_kipsql_query_bench().await.unwrap();
init_fncksql_query_bench().await.unwrap();
}

Database::<KipStorage>::with_kipdb(QUERY_BENCH_KIPSQL_PATH)
Database::<KipStorage>::with_kipdb(QUERY_BENCH_FNCK_SQL_PATH)
.await
.unwrap()
});
Expand Down Expand Up @@ -140,7 +142,7 @@ fn query_on_execute(c: &mut Criterion) {
});
}

c.bench_function(format!("KipSQL: {}", QUERY_CASE).as_str(), |b| {
c.bench_function(format!("FnckSQL: {}", QUERY_CASE).as_str(), |b| {
b.to_async(&rt).iter(|| async {
let _tuples = database.run(QUERY_CASE).await.unwrap();
})
Expand Down
10 changes: 5 additions & 5 deletions examples/hello_world.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use fnck_sql::db::{Database, DatabaseError};
use fnck_sql::implement_from_tuple;
use fnck_sql::types::tuple::Tuple;
use fnck_sql::types::value::DataValue;
use fnck_sql::types::LogicalType;
use itertools::Itertools;
use kip_sql::db::{Database, DatabaseError};
use kip_sql::implement_from_tuple;
use kip_sql::types::tuple::Tuple;
use kip_sql::types::value::DataValue;
use kip_sql::types::LogicalType;

#[derive(Default, Debug, PartialEq)]
struct MyStruct {
Expand Down
2 changes: 1 addition & 1 deletion examples/transaction.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use kip_sql::db::{Database, DatabaseError};
use fnck_sql::db::{Database, DatabaseError};

#[tokio::main]
async fn main() -> Result<(), DatabaseError> {
Expand Down
Loading

0 comments on commit 01b3e6b

Please sign in to comment.