Crates.io | kip-sql |
lib.rs | kip-sql |
version | 0.0.1-alpha.8 |
source | src |
created_at | 2023-09-30 17:19:22.044669 |
updated_at | 2024-01-12 18:12:23.943931 |
description | build the SQL layer of KipDB database |
homepage | |
repository | https://github.com/KipData/KipSQL |
max_upload_size | |
id | 988747 |
size | 1,807,801 |
Built by @KipData ██╗ ██╗██╗██████╗ ███████╗ ██████╗ ██╗ ██║ ██╔╝██║██╔══██╗██╔════╝██╔═══██╗██║ █████╔╝ ██║██████╔╝███████╗██║ ██║██║ ██╔═██╗ ██║██╔═══╝ ╚════██║██║▄▄ ██║██║ ██║ ██╗██║██║ ███████║╚██████╔╝███████╗ ╚═╝ ╚═╝╚═╝╚═╝ ╚══════╝ ╚══▀▀═╝ ╚══════╝ ----------------------------------- Embedded SQL DBMS
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.
Welcome to our WebSite, Power By KipSQL: http://www.kipdata.site/
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:
features = ["marcos"]
#[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;
}
}
));
features = ["codegen_execute"]
KipSQL uses the Apache 2.0 license to strike a balance between open contributions and allowing you to use the software however you want.