jackey / KipSQL

build the SQL layer of KipDB database

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

KipSQL

Lightweight SQL calculation engine, as the SQL layer of KipDB, implemented with TalentPlan's TinySQL as the reference standard

Architecture

architecture

Get Started

Install rust toolchain first.

cargo run

test command

create table t1 (a int, b int);

insert into t1 (a, b) values (1, 1), (5, 3), (5, 2);

update t1 set a = 0 where b > 1;

delete from t1 where b > 1;

select * from t1;

select * from t1 order by a asc nulls first

select count(distinct a) from t1;

truncate table t1;

drop table t1;

Using KipSQL in code

let kipsql = Database::with_kipdb("./data").await?;

let tupes = db.run("select * from t1").await?;

Storage Support:

  • KipDB
  • Memory

demo

Features

  • DDL
    • Create
      • Table
      • Index
    • Drop
      • Table
      • Index
    • Truncate
  • DQL
    • Select
    • Where
    • Distinct
    • Alias
    • Aggregation: count()/sum()/avg()/min()/max()
    • Subquery
    • Join: Inner/Left/Right/Full Cross(x)
    • Group By
    • Having
    • Order By
    • Limit
  • DML
    • Insert
    • Update
    • Delete
  • DataTypes
    • Invalid
    • SqlNull
    • Boolean
    • Tinyint
    • UTinyint
    • Smallint
    • USmallint
    • Integer
    • UInteger
    • Bigint
    • UBigint
    • Float
    • Double
    • Varchar
    • DateTime
  • Optimizer rules
    • Limit Project Transpose
    • Eliminate Limits
    • Push Limit Through Join
    • Push Limit Into Scan
    • Combine Filters
    • Column Pruning
    • Collapse Project

Thanks For

About

build the SQL layer of KipDB database


Languages

Language:Rust 100.0%