Coder Social home page Coder Social logo

kipsql's Introduction

Built by @KipData

██╗  ██╗██╗██████╗ ███████╗ ██████╗ ██╗
██║ ██╔╝██║██╔══██╗██╔════╝██╔═══██╗██║
█████╔╝ ██║██████╔╝███████╗██║   ██║██║
██╔═██╗ ██║██╔═══╝ ╚════██║██║▄▄ ██║██║
     ██║  ██╗██║██║     ███████║╚██████╔╝███████╗
     ╚═╝  ╚═╝╚═╝╚═╝     ╚══════╝ ╚══▀▀═╝ ╚══════╝
-----------------------------------
Embedded SQL DBMS

The Lightweight Embedded OLTP Open-source Database

  CI    

github star github fork

What is KipSQL

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.

If you are a developer of the following applications, we very much welcome you to try using KipSQL and provide your experience and opinions on using it.

  • personal website
  • desktop/mobile application
  • learning database
  • platform bot

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

Quick Started

Clone the repository

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

Install rust toolchain first.

cargo run

Example

create table blog (id int primary key, title varchar unique);

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

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

select * from blog order by title desc nulls first

select count(distinct id) from blog;

delete from blog where title like 'Kip%';

truncate table blog;

drop table blog;

Using KipSQL in code

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

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

Storage Support:

  • KipDB

Features

  • ORM Mapping
#[derive(Debug, Clone, Default)]
pub struct Post {
    pub post_title: String,
    pub post_date: NaiveDateTime,
    pub post_body: String,
}

implement_from_tuple!(Post, (
    post_title: String => |post: &mut Post, value: DataValue| {
        if let Some(title) = value.utf8() {
            post.post_title = title;
        }
    },
    post_date: NaiveDateTime => |post: &mut Post, value: DataValue| {
        if let Some(date_time) = value.datetime() {
            post.post_date = date_time;
        }
    },
    post_body: String => |post: &mut Post, value: DataValue| {
        if let Some(body) = value.utf8() {
            post.post_body = body;
        }
    }
));
  • MVCC Transaction
    • Optimistic
  • SQL field options
    • not null
    • null
    • unique
    • primary key
  • SQL where options
    • is null
    • is not null
    • like
    • not like
    • in
    • not in
  • Supports index type
    • Unique Index
  • Supports multiple primary key types
    • Tinyint
    • UTinyint
    • Smallint
    • USmallint
    • Integer
    • UInteger
    • Bigint
    • UBigint
    • Varchar
  • DDL
    • Create
      • Table
      • Index
    • Drop
      • Table
      • Index
    • Truncate
  • DQL
    • Select
      • SeqScan
      • IndexScan
    • Where
    • Distinct
    • Alias
    • Aggregation: count()/sum()/avg()/min()/max()
    • SubQuery(from)
    • Join: Inner/Left/Right/Full Cross(x)
    • Group By
    • Having
    • Order By
    • Limit
  • DML
    • Insert
    • Insert Overwrite
    • Update
    • Delete
  • DataTypes
    • Invalid
    • SqlNull
    • Boolean
    • Tinyint
    • UTinyint
    • Smallint
    • USmallint
    • Integer
    • UInteger
    • Bigint
    • UBigint
    • Float
    • Double
    • Varchar
    • Date
    • DateTime
  • Optimizer rules
    • Limit Project Transpose
    • Eliminate Limits
    • Push Limit Through Join
    • Push Limit Into Scan
    • Combine Filters
    • Column Pruning
    • Collapse Project

License

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

Thanks For

kipsql's People

Contributors

kkould avatar loloxwg avatar ge-fighting avatar eliasyaoyc avatar guojidan avatar lewiszlw avatar arlottang avatar joeyscat avatar mayingbo avatar sacloudy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.