Skip to content

docs: document driver binary and entrypoint naming convention #4751

Description

@abonander

What feature or improvement would you like to see?

When I first set up adbc_clickhouse, I didn't realize that there was an expected naming convention for ADBC drivers: ClickHouse/adbc_clickhouse#66

As of writing, this is not really documented anywhere:

The only discussion I found regarding naming conventions in my initial research was in the docs for adbc_ffi::export_driver!(), which doesn't prescribe a naming convention but just explains how the entrypoint symbol lookup works: https://docs.rs/adbc_ffi/0.23.0/adbc_ffi/macro.export_driver.html

I chose adbc_clickhouse (and AdbcClickhouseInit) because it felt more concise than adbc_driver_clickhouse (and AdbcDriverClickhouseInit) while still seeming to work for the rules laid out by export_driver!(). It loaded just fine with the Rust adbc_driver_manager crate.

The example dummy driver for Rust appears to support this choice:

However, it sounds like some driver managers specifically look for AdbcDriver*Init and break if you try to load a driver that doesn't follow that convention. Unfortunately, ClickHouse/adbc_clickhouse#66 is all the context I have here.

To work around this, the driver binary ends up getting renamed during the release process to libadbc_driver_clickhouse.so: https://github.com/adbc-drivers/clickhouse/blob/main/src/ci/scripts/build.sh#L46

And an additional AdbcDriverClickhouseInit entrypoint gets added for compatibility with old driver managers that don't recognize the entrypoint manifest key: https://github.com/adbc-drivers/clickhouse/blob/41ef9369dae4c594edc926cdf6858140a949cdb3/src/ci/scripts/pre-build.sh#L33-L39

I'm not really comfortable with this situation because it means the driver installed through dbc has a different filename and entrypoint than if the driver is built manually, which could confuse and frustrate users trying to contribute to the driver or test the latest changes on main.

We're prepared to resolve this for good on our end (ClickHouse/adbc_clickhouse#75). However, this could have been avoided if the expected naming conventions were documented better.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions