Skip to content

Commit 5f66899

Browse files
committed
feat: introduce postgis functions
1 parent e7fde70 commit 5f66899

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

datafusion-postgres/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ bytes.workspace = true
1818
async-trait = "0.1"
1919
chrono.workspace = true
2020
datafusion.workspace = true
21-
geodatafusion = { version = "0.1", optional = true }
21+
geodatafusion = { version = "0.1.1", optional = true }
2222
datafusion-pg-catalog = { path = "../datafusion-pg-catalog", version = "0.12.0" }
2323
futures.workspace = true
2424
getset = "0.1"
@@ -35,5 +35,5 @@ rustls-pki-types = "1.0"
3535
env_logger = "0.11"
3636

3737
[features]
38-
default = ["geo"]
39-
geo = ["geodatafusion"]
38+
default = []
39+
postgis = ["geodatafusion"]

datafusion-postgres/src/lib.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,8 @@ pub async fn serve(
8888
opts: &ServerOptions,
8989
auth_manager: Arc<AuthManager>,
9090
) -> Result<(), std::io::Error> {
91-
#[cfg(feature = "geo")]
92-
session_context
93-
.register_udf(geodatafusion::udf::native::constructors::MakePoint::default().into());
91+
#[cfg(feature = "postgis")]
92+
geodatafusion::register(&session_context);
9493

9594
// Create the handler factory with authentication
9695
let factory = Arc::new(HandlerFactory::new(session_context, auth_manager));
@@ -106,6 +105,9 @@ pub async fn serve_with_hooks(
106105
auth_manager: Arc<AuthManager>,
107106
hooks: Vec<Arc<dyn QueryHook>>,
108107
) -> Result<(), std::io::Error> {
108+
#[cfg(feature = "postgis")]
109+
geodatafusion::register(&session_context);
110+
109111
// Create the handler factory with authentication
110112
let factory = Arc::new(HandlerFactory::new_with_hooks(
111113
session_context,

0 commit comments

Comments
 (0)