Skip to content

Commit

Permalink
Pass EXTENSION_NAME to rust code
Browse files Browse the repository at this point in the history
  • Loading branch information
carlopi committed Nov 13, 2024
1 parent 469b155 commit 90c91f8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,11 @@ impl VTab for HelloVTab {
}
}

const EXTENSION_NAME: &str = env!("CARGO_PKG_NAME");

#[duckdb_entrypoint_c_api(ext_name = "rusty_quack", min_duckdb_version = "v0.0.1")]
pub unsafe fn extension_entrypoint(con: Connection) -> Result<(), Box<dyn Error>> {
con.register_table_function::<HelloVTab>("rusty_quack")
con.register_table_function::<HelloVTab>(EXTENSION_NAME)
.expect("Failed to register hello table function");
Ok(())
}

0 comments on commit 90c91f8

Please sign in to comment.