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
Copy file name to clipboardExpand all lines: README.md
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,6 +83,30 @@ GIGAPI SELECT * FROM my_measurement WHERE time > now() - interval '1 hour';
83
83
84
84
Behind the scenes, the extension performs the same steps as the `gigapi()` table function, rewriting the query to read from specific data files before execution. If a query is not prefixed with `GIGAPI`, it will be handled by DuckDB's default planner.
85
85
86
+
## ATTACH Support for GigAPI
87
+
88
+
The extension supports DuckDB's `ATTACH` statement, allowing you to create a virtual schema that pipes all table references through the GigAPI metadata engine. This enables seamless integration with tools and workflows that expect standard DuckDB schemas and tables.
89
+
90
+
### Usage
91
+
92
+
```sql
93
+
-- Attach a GigAPI database as schema 'bq'
94
+
ATTACH 'mydb'AS bq (TYPE gigapi, READ_ONLY);
95
+
96
+
-- List all tables in the attached GigAPI schema
97
+
SHOW TABLES;
98
+
99
+
-- Query a table from the attached schema
100
+
SELECT*FROMbq.example;
101
+
```
102
+
103
+
**How it works:**
104
+
- Any table reference in the attached schema (e.g., `bq.example`) is transparently routed through the `gigapi()` table function.
105
+
- You do not need to manually create views or enumerate tables; the extension handles all resolution dynamically.
106
+
- Metadata queries (e.g., `SHOW TABLES`, `DESCRIBE`, etc.) are also supported and routed through GigAPI.
107
+
108
+
This makes it easy to use GigAPI-backed data as if it were a native DuckDB database.
0 commit comments