Skip to content

Commit

Permalink
WIP: Rust refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
mmastrac committed Nov 22, 2024
1 parent d7f1f4c commit f737ca0
Show file tree
Hide file tree
Showing 69 changed files with 456 additions and 65 deletions.
45 changes: 44 additions & 1 deletion Cargo.lock

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

14 changes: 10 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,23 @@ members = [
"edb/edgeql-parser/edgeql-parser-derive",
"edb/edgeql-parser/edgeql-parser-python",
"edb/graphql-rewrite",
"edb/server/conn_pool",
"edb/server/pgrust",
"edb/server/http",
"edb/native/conn_pool",
"edb/native/pgrust",
"edb/native/http",
"edb/native/pyo3_util",
"edb/server/_rust_native"
]
resolver = "2"

[workspace.dependencies]
pyo3 = { version = "0.23.1", features = ["extension-module", "serde"] }
pyo3 = { version = "0.23.1", features = ["extension-module", "serde", "macros"] }
tokio = { version = "1", features = ["rt", "rt-multi-thread", "macros", "time", "sync", "net", "io-util"] }
tracing = "0.1.40"
tracing-subscriber = "0.3.18"
conn_pool = { path = "edb/native/conn_pool" }
pgrust = { path = "edb/native/pgrust" }
http = { path = "edb/native/http" }
pyo3_util = { path = "edb/native/pyo3_util" }

[profile.release]
debug = true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "conn-pool"
name = "conn_pool"
version = "0.1.0"
license = "MIT/Apache-2.0"
authors = ["MagicStack Inc. <[email protected]>"]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ pub use pool::{Pool, PoolConfig, PoolHandle};
pub mod test;

#[cfg(feature = "python_extension")]
mod python;
pub mod python;
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ impl LoggingGuard {
}

#[pymodule]
fn _conn_pool(py: Python, m: &Bound<PyModule>) -> PyResult<()> {
pub fn _conn_pool(py: Python, m: &Bound<PyModule>) -> PyResult<()> {
m.add_class::<ConnPool>()?;
m.add_class::<LoggingGuard>()?;
m.add("InternalError", py.get_type::<InternalError>())?;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion edb/server/http/src/lib.rs → edb/native/http/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#[cfg(feature = "python_extension")]
mod python;
pub mod python;
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ impl Http {
}

#[pymodule]
fn _http(py: Python, m: &Bound<PyModule>) -> PyResult<()> {
pub fn _http(py: Python, m: &Bound<PyModule>) -> PyResult<()> {
m.add_class::<Http>()?;
m.add("InternalError", py.get_type::<InternalError>())?;

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
23 changes: 23 additions & 0 deletions edb/native/pyo3_util/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[package]
name = "pyo3_util"
version = "0.1.0"
license = "MIT/Apache-2.0"
authors = ["MagicStack Inc. <[email protected]>"]
edition = "2021"

[lint]
workspace = true

[dependencies]
pyo3 = { workspace = true }
tokio.workspace = true
tracing.workspace = true
tracing-subscriber.workspace = true
nix = { version = "0.29", features = ["fs"] }

scopeguard = "1"
thiserror = "1"

[lib]
crate-type = ["lib", "cdylib"]
path = "src/lib.rs"
1 change: 1 addition & 0 deletions edb/native/pyo3_util/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod logging;
Loading

0 comments on commit f737ca0

Please sign in to comment.