Skip to content

Commit

Permalink
Merge pull request #4 from easeq/fix-commit-error
Browse files Browse the repository at this point in the history
Fix commit error
  • Loading branch information
easeq authored Oct 17, 2024
2 parents feda98b + f18c005 commit 8d8625c
Show file tree
Hide file tree
Showing 16 changed files with 70 additions and 30 deletions.
60 changes: 52 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/authors-async/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ postgresql_embedded = { version = "0.16.3", features = ["blocking", "bundled"] }
refinery = { version = "0.8.14", features = ["postgres", "tokio-postgres"] }
serde = "1.0.210"
serde_json = "1.0.128"
sqlc-core = { version = "0.1.0", path = "../../sqlc-core", default-features = false, features = ["with-bit-vec-0_6", "with-cidr-0_2", "with-eui48-1", "with-geo-types-0_7", "with-serde_json-1", "with-time-0_3", "with-tokio-postgres", "with-uuid-1"] }
sqlc-derive = { version = "0.1.0", path = "../../sqlc-derive", default-features = false, features = ["with-tokio-postgres"] }
sqlc-core = { version = "0.2.0", path = "../../sqlc-core", default-features = false, features = ["with-bit-vec-0_6", "with-cidr-0_2", "with-eui48-1", "with-geo-types-0_7", "with-serde_json-1", "with-time-0_3", "with-tokio-postgres", "with-uuid-1"] }
sqlc-derive = { version = "0.2.0", path = "../../sqlc-derive", default-features = false, features = ["with-tokio-postgres"] }
time = "0.3.36"
tokio = { version = "1.40.0", features = ["rt", "rt-multi-thread", "macros", "signal"] }
tokio-postgres = { version = "0.7.12", features = ["with-uuid-1", "with-time-0_3", "array-impls"] }
Expand Down
2 changes: 1 addition & 1 deletion examples/authors-async/sqlc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins:
- RUST_LOG
wasm:
url: file://./../../target/wasm32-wasip1/release/sqlc-gen.wasm
sha256: 8920bd7d234e7705f537979be05780fd08a8285fbae26afec268caad3d064867
sha256: cf76c258ee5b6fce3b5fbd75b4cabdf31cc3f87a3c5cae99314d2895e88ba0c7
# - name: js
# process:
# cmd: sqlc-gen-json
Expand Down
4 changes: 2 additions & 2 deletions examples/authors-deadpool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ postgresql_embedded = { version = "0.16.3", features = ["blocking", "bundled"] }
refinery = { version = "0.8.14", features = ["postgres", "tokio-postgres"] }
serde = "1.0.210"
serde_json = "1.0.128"
sqlc-core = { version = "0.1.0", path = "../../sqlc-core", default-features = false, features = ["with-bit-vec-0_6", "with-cidr-0_2", "with-eui48-1", "with-geo-types-0_7", "with-serde_json-1", "with-time-0_3", "with-tokio-postgres", "with-uuid-1"] }
sqlc-derive = { version = "0.1.0", path = "../../sqlc-derive", default-features = false, features = ["with-tokio-postgres"] }
sqlc-core = { version = "0.2.0", path = "../../sqlc-core", default-features = false, features = ["with-bit-vec-0_6", "with-cidr-0_2", "with-eui48-1", "with-geo-types-0_7", "with-serde_json-1", "with-time-0_3", "with-tokio-postgres", "with-uuid-1"] }
sqlc-derive = { version = "0.2.0", path = "../../sqlc-derive", default-features = false, features = ["with-tokio-postgres"] }
time = "0.3.36"
tokio = { version = "1.40.0", features = ["rt", "rt-multi-thread", "macros", "signal"] }
tokio-postgres = { version = "0.7.12", features = ["with-uuid-1", "with-time-0_3", "array-impls"] }
Expand Down
2 changes: 1 addition & 1 deletion examples/authors-deadpool/sqlc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins:
- RUST_LOG
wasm:
url: file://./../../target/wasm32-wasip1/release/sqlc-gen.wasm
sha256: 8920bd7d234e7705f537979be05780fd08a8285fbae26afec268caad3d064867
sha256: cf76c258ee5b6fce3b5fbd75b4cabdf31cc3f87a3c5cae99314d2895e88ba0c7
# - name: js
# process:
# cmd: sqlc-gen-json
Expand Down
4 changes: 2 additions & 2 deletions examples/authors/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ postgresql_embedded = { version = "0.16.3", features = ["blocking", "bundled"] }
refinery = { version = "0.8.14", features = ["postgres"] }
serde = "1.0.210"
serde_json = "1.0.128"
sqlc-core = { version = "0.1.0", path = "../../sqlc-core", features = ["with-bit-vec-0_6", "with-cidr-0_2", "with-eui48-1", "with-geo-types-0_7", "with-serde_json-1", "with-time-0_3", "with-uuid-1"], default-features = false }
sqlc-derive = { version = "0.1.0", path = "../../sqlc-derive" }
sqlc-core = { version = "0.2.0", path = "../../sqlc-core", features = ["with-bit-vec-0_6", "with-cidr-0_2", "with-eui48-1", "with-geo-types-0_7", "with-serde_json-1", "with-time-0_3", "with-uuid-1"], default-features = false }
sqlc-derive = { version = "0.2.0", path = "../../sqlc-derive" }
time = { version = "0.3.36", features = ["local-offset", "serde"] }
uuid = "1.10.0"
2 changes: 1 addition & 1 deletion examples/authors/sqlc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins:
- RUST_LOG
wasm:
url: file://./../../target/wasm32-wasip1/release/sqlc-gen.wasm
sha256: 8920bd7d234e7705f537979be05780fd08a8285fbae26afec268caad3d064867
sha256: cf76c258ee5b6fce3b5fbd75b4cabdf31cc3f87a3c5cae99314d2895e88ba0c7
# - name: js
# process:
# cmd: sqlc-gen-json
Expand Down
2 changes: 1 addition & 1 deletion sqlc-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sqlc-core"
version = "0.1.0"
version = "0.2.0"
edition = "2021"

[dependencies]
Expand Down
4 changes: 2 additions & 2 deletions sqlc-derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sqlc-derive"
version = "0.1.0"
version = "0.2.0"
edition = "2021"

[lib]
Expand All @@ -9,7 +9,7 @@ proc-macro = true
[dependencies]
proc-macro2 = "1.0.86"
quote = "1.0.37"
sqlc-core = { version = "0.1.0", path = "../sqlc-core" }
sqlc-core = { version = "0.2.0", path = "../sqlc-core" }
syn = "2.0.77"

[features]
Expand Down
2 changes: 1 addition & 1 deletion sqlc-gen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sqlc-gen"
version = "0.1.0"
version = "0.2.1"
edition = "2018"

[profile.release]
Expand Down
2 changes: 1 addition & 1 deletion sqlc-gen/examples/authors/sqlc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins:
- RUST_LOG
wasm:
url: file://./../../../target/wasm32-wasip1/release/sqlc-gen.wasm
sha256: d5c79985e5590cd3f29b0236203e9a054744d4edbbdfef2b91dc418dce8c0066
sha256: cf76c258ee5b6fce3b5fbd75b4cabdf31cc3f87a3c5cae99314d2895e88ba0c7
#
# - name: js
# process:
Expand Down
2 changes: 1 addition & 1 deletion sqlc-gen/examples/batch/sqlc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
],
"wasm": {
"url": "file://./../../../target/wasm32-wasip1/release/sqlc-gen.wasm",
"sha256": "d5c79985e5590cd3f29b0236203e9a054744d4edbbdfef2b91dc418dce8c0066"
"sha256": "cf76c258ee5b6fce3b5fbd75b4cabdf31cc3f87a3c5cae99314d2895e88ba0c7"
}
}
],
Expand Down
2 changes: 1 addition & 1 deletion sqlc-gen/examples/booktest/sqlc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins:
- RUST_LOG
wasm:
url: file://./../../../target/wasm32-wasip1/release/sqlc-gen.wasm
sha256: d5c79985e5590cd3f29b0236203e9a054744d4edbbdfef2b91dc418dce8c0066
sha256: cf76c258ee5b6fce3b5fbd75b4cabdf31cc3f87a3c5cae99314d2895e88ba0c7
#
# - name: js
# process:
Expand Down
2 changes: 1 addition & 1 deletion sqlc-gen/examples/jets/sqlc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
],
"wasm": {
"url": "file://./../../../target/wasm32-wasip1/release/sqlc-gen.wasm",
"sha256": "d5c79985e5590cd3f29b0236203e9a054744d4edbbdfef2b91dc418dce8c0066"
"sha256": "cf76c258ee5b6fce3b5fbd75b4cabdf31cc3f87a3c5cae99314d2895e88ba0c7"
}
}
],
Expand Down
2 changes: 1 addition & 1 deletion sqlc-gen/examples/ondeck/sqlc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
],
"wasm": {
"url": "file://./../../../target/wasm32-wasip1/release/sqlc-gen.wasm",
"sha256": "d5c79985e5590cd3f29b0236203e9a054744d4edbbdfef2b91dc418dce8c0066"
"sha256": "cf76c258ee5b6fce3b5fbd75b4cabdf31cc3f87a3c5cae99314d2895e88ba0c7"
}
}
],
Expand Down
4 changes: 0 additions & 4 deletions sqlc-gen/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ pub fn create_codegen_response(content: &str) -> plugin::GenerateResponse {
}

pub fn generate_rust_code(req: plugin::GenerateRequest) -> String {
// println!("{:?}", req);
let tokens = codegen::CodeBuilder::new(req).generate_code();
let syntax_tree = syn::parse_file(tokens.to_string().as_str()).unwrap();
return prettyplease::unparse(&syntax_tree);
Expand All @@ -39,9 +38,6 @@ fn main() -> Result<(), prost::DecodeError> {
let mut buffer: Vec<u8> = Vec::new();
stdin.read_to_end(&mut buffer).unwrap();

let buffer = stdin.fill_buf().unwrap();
// panic!("{:?}", buffer.len());

let req = deserialize_codegen_request(&buffer)?;

let out = generate_rust_code(req);
Expand Down

0 comments on commit 8d8625c

Please sign in to comment.