Skip to content

Commit

Permalink
feat(schema-engine-wasm): wasm-compatible schema-connector
Browse files Browse the repository at this point in the history
  • Loading branch information
jkomyno committed Jan 7, 2025
1 parent ddc7eb1 commit 5cfc424
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
23 changes: 21 additions & 2 deletions schema-engine/connectors/schema-connector/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,32 @@ name = "schema-connector"
version = "0.1.0"
edition = "2021"

[features]
postgresql = ["psl/postgresql", "quaint/postgresql"]
postgresql-native = ["postgresql", "quaint/pooled"]
sqlite = ["psl/sqlite", "quaint/sqlite"]
sqlite-native = ["sqlite", "quaint/pooled", "quaint/sqlite-native"]
mysql = ["psl/mysql", "quaint/mysql"]
mysql-native = ["mysql", "quaint/pooled"]
mssql = ["psl/mssql", "quaint/mssql"]
mssql-native = ["mssql", "quaint/pooled"]
cockroachdb = ["psl/cockroachdb", "quaint/postgresql"]
cockroachdb-native = ["cockroachdb", "quaint/pooled"]
all-native = [
"postgresql-native",
"sqlite-native",
"mysql-native",
"mssql-native",
"cockroachdb-native",
]

[dependencies]
psl.workspace = true
quaint = { workspace = true, features = ["all-native", "pooled"] }
quaint.workspace = true
serde.workspace = true
serde_json.workspace = true
user-facing-errors = { path = "../../../libs/user-facing-errors", features = [
"all-native",
"quaint",
] }

chrono.workspace = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,15 @@ impl IntrospectionContext {
/// The SQL family we're using currently.
pub fn sql_family(&self) -> SqlFamily {
match self.datasource().active_provider {
#[cfg(feature = "postgresql")]
"postgresql" => SqlFamily::Postgres,
#[cfg(feature = "cockroachdb")]
"cockroachdb" => SqlFamily::Postgres,
#[cfg(feature = "sqlite")]
"sqlite" => SqlFamily::Sqlite,
#[cfg(feature = "mssql")]
"sqlserver" => SqlFamily::Mssql,
#[cfg(feature = "mysql")]
"mysql" => SqlFamily::Mysql,
name => unreachable!("The name `{}` for the datamodel connector is not known", name),
}
Expand Down

0 comments on commit 5cfc424

Please sign in to comment.