π Querying Remote Databases with the ADBC Scanner Community Extension for DuckDB¶
The ADBC Scanner is a new DuckDB Community Extension developed by Query.Farm that allows you to connect to and query remote databases directly from DuckDB β via the Apache Arrow Database Connectivity (ADBC) framework.
With this extension, you can connect DuckDB to any ADBC-compatible source (like GizmoSQL, Snowflake, PostgreSQL, or SQLite) and run SQL queries remotely, as if they were local tables.
You can even use ADBC Scanner from a GizmoSQL server - allowing you to connect to remote databases from within GizmoSQL itself, including to other GizmoSQL instances!
π§© Overview¶
- Extension:
adbc_scanner - Author: Query.Farm
- Category: Community Extension
- Purpose: Query remote databases over ADBC
- Supported Backends: Any database with a compatible ADBC driver
- Example Driver Used:
flightsql(for Arrow Flight SQL)
βοΈSetup ADBC Drivers¶
You can get ADBC Drivers for your target platform pretty easily using Columnar's dbc tool - under: "Which data system do you want to connect to?" - choose: "Flight SQL":

π§ͺ Example: Query GizmoSQL from DuckDB¶
You can try the extension right now against a public GizmoSQL instance hosted by GizmoData β no setup required.
1οΈβ£ Launch DuckDB CLI¶
You should see:
2οΈβ£ Install and Load the Extension¶
INSTALL adbc_scanner FROM community;
LOAD adbc_scanner;
-- Run this to keep your extensions up to date...
UPDATE EXTENSIONS;
This downloads and registers the ADBC Scanner extension for your DuckDB environment.
3οΈβ£ Connect to a Remote GizmoSQL Instance¶
Create a secret and a connection to the remote GizmoSQL instance:
CREATE SECRET gizmosql_secret (
TYPE adbc,
SCOPE 'grpc+tls://try-gizmosql-adbc.gizmodata.com:31337',
driver 'flightsql',
uri 'grpc+tls://try-gizmosql-adbc.gizmodata.com:31337',
username 'adbc-scanner',
password 'QueryDotFarmRules!123'
);
ATTACH 'grpc+tls://try-gizmosql-adbc.gizmodata.com:31337' AS gizmosql_db (
TYPE adbc
);
This creates an encrypted and authenticated Flight SQL connection to the GizmoSQL service hosted by GizmoData.
Connecting with Self-Signed Certificates (TLS Skip Verify)¶
If your GizmoSQL server uses a self-signed certificate (common in development or internal environments), you can skip TLS certificate verification by adding extra_options to the secret:
CREATE SECRET gizmosql_secret (
TYPE adbc,
SCOPE 'grpc+tls://localhost:31337',
driver 'flightsql',
uri 'grpc+tls://localhost:31337',
username 'gizmosql_user',
password 'gizmosql_password',
extra_options MAP {
'adbc.flight.sql.client_option.tls_skip_verify': 'true'
}
);
ATTACH 'grpc+tls://localhost:31337' AS gizmosql_db (
TYPE adbc
);
Note: Only use
tls_skip_verifyfor development or trusted internal environments β not in production.
4οΈβ£ Run a Remote Query!¶
Now you can query remote data as if it were local.
-- Make the remote instance first on the search path so you don't have to type: catalog.schema.table for each SQL statement...
USE gizmosql_db;
-- Select from the table as if it were local
SELECT *
FROM region;
Output:
βββββββββββββββ¬ββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β r_regionkey β r_name β r_comment β
β int32 β varchar β varchar β
βββββββββββββββΌββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 0 β AFRICA β ar packages. regular excuses among the ironic requests cajole fluffily blithely final requests. furiously express p β
β 1 β AMERICA β s are. furiously even pinto bea β
β 2 β ASIA β c, special dependencies around β
β 3 β EUROPE β e dolphins are furiously about the carefully β
β 4 β MIDDLE EAST β foxes boost furiously along the carefully dogged tithes. slyly regular orbits according to the special epit β
βββββββββββββββ΄ββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βοΈ Under the Hood¶
The adbc_scan() function executes SQL remotely via the ADBC driver and returns results as Arrow RecordBatches.
That means:
- Results are zero-copy streamed into DuckDB via Arrow IPC.
- Queries can push computation to the remote side when supported.
- You can join local and remote data seamlessly.
π Related Resources¶
- Official Query.Farm Documentation
- DuckDB Community Extensions Directory
- Apache Arrow ADBC Specification
- Query.Farm GitHub
- GizmoSQL Open Source Project
- GizmoData Site
π‘ Next Steps¶
-
Try substituting other remote queries - like this one that does predicate pushdown to the remote GizmoSQL database connection:
-
Explore pushdown capabilities with complex filters or aggregations.
- Combine ADBC remote tables with local Parquet, CSV, or in-memory data for hybrid analytics.
- Experiment with other ADBC drivers: PostgreSQL, SQLite, Snowflake, etc.
π§ Summary¶
The ADBC Scanner extension by Query.Farm opens up a new era of federated analytics in DuckDB β
letting you treat any remote database as a native data source, with Arrow Flight SQL performance and DuckDB simplicity.
βQuery remote data at local speed β all from the DuckDB prompt.β π¦β‘