You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`adbc_schema(handle, table_name)` - Returns the Arrow schema for a specific table (field names, Arrow types, nullability).
102
102
103
+
### Storage Extension (ATTACH)
104
+
105
+
The extension also provides a storage extension that allows attaching ADBC data sources as DuckDB databases. This enables querying remote tables using standard SQL syntax without explicit function calls.
-`batch_size` - Hint for number of rows per batch when scanning tables (default: driver-specific). Larger batch sizes can reduce network round-trips for remote databases.
121
+
- Other options are passed directly to the ADBC driver (e.g., `username`, `password`)
Copy file name to clipboardExpand all lines: docs/README.md
+77Lines changed: 77 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -726,6 +726,83 @@ DROP PERSISTENT SECRET my_postgres;
726
726
- Persistent secrets are stored encrypted on disk
727
727
- Secrets are scoped to the current DuckDB connection/session
728
728
729
+
## Storage Extension (ATTACH)
730
+
731
+
The ADBC Scanner extension provides a storage extension that allows you to attach ADBC data sources as DuckDB databases. This enables querying remote tables using standard SQL syntax without explicit function calls.
|`driver`| Yes | Driver name (e.g., `'sqlite'`, `'postgresql'`), path to shared library, or manifest name |
753
+
|`entrypoint`| No | Custom driver entry point function name |
754
+
|`search_paths`| No | Additional paths to search for driver manifests |
755
+
|`use_manifests`| No | Enable/disable manifest search (default: `'true'`) |
756
+
|`batch_size`| No | Hint for number of rows per batch when scanning tables (default: driver-specific). Larger batch sizes can reduce network round-trips for remote databases. |
757
+
758
+
Any other options are passed directly to the ADBC driver (e.g., `username`, `password`).
-- Attach with custom batch size (useful for network databases)
775
+
ATTACH 'postgresql://localhost/mydb'AS pg_db (
776
+
TYPE adbc,
777
+
driver 'postgresql',
778
+
batch_size 65536
779
+
);
780
+
781
+
-- Query attached databases
782
+
SELECT*FROMpg_db.public.users WHERE active = true;
783
+
SELECTCOUNT(*) FROMsqlite_db.main.orders;
784
+
785
+
-- Join tables from different attached databases
786
+
SELECTu.name, o.total
787
+
FROMpg_db.public.users u
788
+
JOINsqlite_db.main.orders o ONu.id=o.user_id;
789
+
```
790
+
791
+
### Features
792
+
793
+
When querying attached ADBC tables, the following optimizations are automatically applied:
794
+
795
+
-**Projection pushdown**: Only requested columns are fetched from the remote database
796
+
-**Filter pushdown**: WHERE clauses are pushed to the remote database with parameter binding
797
+
-**Cardinality estimation**: Row count statistics are used for query planning
798
+
-**Progress reporting**: Scan progress is reported based on estimated row counts
799
+
800
+
### Limitations
801
+
802
+
- Attached ADBC databases are read-only; INSERT, UPDATE, and DELETE operations are not supported through the ATTACH interface (use `adbc_execute` instead)
803
+
- Schema creation and modification are not supported
804
+
- The connection remains open while the database is attached
805
+
729
806
## ADBC Drivers
730
807
731
808
ADBC drivers are available for many databases. When using driver manifests (see below), you can reference drivers by their short name:
0 commit comments