-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: use `ResultIter`(`DatabaseIter`&`TransactionIter`) for `DataBase` result return * refactor: enumerate the childrens attribute of `LogicalPlan` * chore: fix word (`macros`)
- Loading branch information
Showing
62 changed files
with
1,183 additions
and
829 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
[package] | ||
name = "fnck_sql" | ||
version = "0.0.6" | ||
version = "0.0.7" | ||
edition = "2021" | ||
authors = ["Kould <[email protected]>", "Xwg <[email protected]>"] | ||
description = "SQL as a Function for Rust" | ||
|
@@ -23,8 +23,8 @@ required-features = ["net"] | |
doctest = false | ||
|
||
[features] | ||
default = ["marcos"] | ||
marcos = [] | ||
default = ["macros"] | ||
macros = [] | ||
net = ["dep:pgwire", "dep:async-trait", "dep:clap", "dep:env_logger", "dep:futures", "dep:log", "dep:tokio"] | ||
|
||
[[bench]] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,24 @@ | ||
use fnck_sql::db::DataBaseBuilder; | ||
use fnck_sql::db::{DataBaseBuilder, ResultIter}; | ||
use fnck_sql::errors::DatabaseError; | ||
|
||
fn main() -> Result<(), DatabaseError> { | ||
let database = DataBaseBuilder::path("./transaction").build()?; | ||
let mut tx_1 = database.new_transaction()?; | ||
let mut transaction = database.new_transaction()?; | ||
|
||
let _ = tx_1.run("create table if not exists t1 (c1 int primary key, c2 int)")?; | ||
let _ = tx_1.run("insert into t1 values(0, 0), (1, 1)")?; | ||
transaction | ||
.run("create table if not exists t1 (c1 int primary key, c2 int)")? | ||
.done()?; | ||
transaction | ||
.run("insert into t1 values(0, 0), (1, 1)")? | ||
.done()?; | ||
|
||
assert!(database.run("select * from t1").is_err()); | ||
|
||
tx_1.commit()?; | ||
transaction.commit()?; | ||
|
||
assert!(database.run("select * from t1").is_ok()); | ||
|
||
let _ = database.run("drop table t1")?; | ||
database.run("drop table t1")?.done()?; | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.