Skip to content

Conversation

@zeroshade
Copy link

@zeroshade zeroshade commented Oct 31, 2025

What this PR includes:

  • AdbcTableFactory
  • ADBCPool
  • Some tests (more needed, unit + integration)
  • Example (under examples)
  • CI
  • Bulk insert capability

Example:

let mut driver = ManagedDriver::load_from_name(
        "duckdb", None, AdbcVersion::V110, LOAD_FLAG_DEFAULT, None).unwrap();

let db = driver.
    new_database_with_opts([
          (OptionDatabase::Uri, "core/examples/duckdb_example.db".into())]).unwrap();

let adbc_conn_pool = Arc::new(ADBCPool::new(db, None)
     .expect("unable to create ADBC Conn pool"));

let table_factory = AdbcTableFactory::new(adbc_conn_pool.clone());
let ctx = SessionContext::new();

ctx.register_table(
    "companies_v2",
    table_factory
        .table_provider(TableReference::bare("companies"))
        .await
        .expect("failed to register table provider"),
).expect("failed to register table");

let df = ctx
        .sql("SELECT * FROM datafusion.public.companies_v2")
        .await
        .expect("select failed");
    df.show().await.expect("show failed");

As I'm not particularly fluent in Rust yet, I'm sure there's lots of areas for improvement in my rust code and simplifications. I'd love feedback and tips/suggestions from anyone, thanks!

@zeroshade zeroshade marked this pull request as ready for review November 3, 2025 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant