Skip to content

Commit b46cef2

Browse files
committed
fix: license update
1 parent 3c70499 commit b46cef2

File tree

2 files changed

+50
-6
lines changed

2 files changed

+50
-6
lines changed

CLAUDE.md

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,51 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
44

55
## Project Overview
66

7-
This is a DuckDB extension called `adbc` that integrates Arrow ADBC (Arrow Database Connectivity) with DuckDB. It's built using the DuckDB extension template. Familairize yourself with the ADBC interface.
7+
This is a DuckDB extension called `adbc` that integrates Arrow ADBC (Arrow Database Connectivity) with DuckDB. It's built using the DuckDB extension template. Familiarize yourself with the ADBC interface.
88

9-
There is a checkout of a similar project under ./odbc-scanner which is the ODBC scanner for DuckDB extension, this adbc extension wants to be very similar to that extension but use the ADBC interface.
9+
There is a checkout of a similar project under ./odbc-scanner which is the ODBC scanner for DuckDB extension. This adbc extension is modeled after that extension but uses the ADBC interface instead.
1010

11-
There is also a checkout of the Airport DuckDB extension under ./airport. The Airport extension integrates DuckDB with Apache Arrow Flight, but it demonstrates C++ code that can read Arrow record batches and return them to DuckDB. The docs for the extension are under ./airports/docs/README.md, but you're mostly going to be interested in airport_take_flight.cpp.
11+
There is also a checkout of the Airport DuckDB extension under ./airport. The Airport extension integrates DuckDB with Apache Arrow Flight and demonstrates C++ code that can read Arrow record batches and return them to DuckDB. The docs are under ./airport/docs/README.md, but you're mostly interested in airport_take_flight.cpp.
12+
13+
## Extension Functions
14+
15+
The extension provides the following functions:
16+
17+
### Connection Management
18+
- `adbc_connect(options)` - Connect to an ADBC data source. Returns a connection handle (BIGINT). Options can be passed as a STRUCT (preferred) or MAP. The `driver` option is required.
19+
- `adbc_disconnect(handle)` - Disconnect from an ADBC data source. Returns true on success.
20+
21+
### Query Execution
22+
- `adbc_scan(handle, query, [params := row(...)])` - Execute a SELECT query and return results as a table. Supports parameterized queries via the optional `params` named parameter.
23+
- `adbc_execute(handle, query)` - Execute DDL/DML statements (CREATE, INSERT, UPDATE, DELETE). Returns affected row count.
24+
25+
### Catalog Functions
26+
- `adbc_info(handle)` - Returns driver/database information (vendor name, version, etc.).
27+
- `adbc_tables(handle)` - Returns list of tables in the database.
28+
29+
### Example Usage
30+
31+
```sql
32+
-- Connect to SQLite (driver path varies by installation)
33+
SET VARIABLE conn = (SELECT adbc_connect({'driver': '/path/to/libadbc_driver_sqlite.dylib', 'uri': ':memory:'}));
34+
35+
-- Query data
36+
SELECT * FROM adbc_scan(getvariable('conn')::BIGINT, 'SELECT 1 AS a, 2 AS b');
37+
38+
-- Parameterized query
39+
SELECT * FROM adbc_scan(getvariable('conn')::BIGINT, 'SELECT ? AS value', params := row(42));
40+
41+
-- Execute DDL/DML
42+
SELECT adbc_execute(getvariable('conn')::BIGINT, 'CREATE TABLE test (id INTEGER, name TEXT)');
43+
SELECT adbc_execute(getvariable('conn')::BIGINT, 'INSERT INTO test VALUES (1, ''hello'')');
44+
45+
-- Catalog functions
46+
SELECT * FROM adbc_info(getvariable('conn')::BIGINT);
47+
SELECT * FROM adbc_tables(getvariable('conn')::BIGINT);
48+
49+
-- Disconnect
50+
SELECT adbc_disconnect(getvariable('conn')::BIGINT);
51+
```
1252

1353
## Build Commands
1454

@@ -40,6 +80,9 @@ make test
4080

4181
# Run debug tests
4282
make test_debug
83+
84+
# Run tests with SQLite driver (requires ADBC_SQLITE_DRIVER env var)
85+
ADBC_SQLITE_DRIVER="/path/to/libadbc_driver_sqlite.dylib" make test
4386
```
4487

4588
Tests are written as [SQLLogicTests](https://duckdb.org/dev/sqllogictest/intro.html) in `test/sql/`.
@@ -52,12 +95,13 @@ Tests are written as [SQLLogicTests](https://duckdb.org/dev/sqllogictest/intro.h
5295

5396
## Architecture
5497

55-
- **Extension entry point**: `src/adbc_extension.cpp` - Registers functions with DuckDB via `LoadInternal()`
98+
- **Extension entry point**: `src/adbc_extension.cpp` - Registers all functions with DuckDB via `LoadInternal()`
99+
- **ADBC functions**: `src/adbc_functions.cpp` - Implements connection management, scanning, catalog, and execute functions
56100
- **Extension class**: `src/include/adbc_extension.hpp` - Defines `AdbcExtension` class inheriting from `duckdb::Extension`
57101
- **Configuration**: `extension_config.cmake` - Tells DuckDB build system to load this extension
58102
- **Dependencies**: `vcpkg.json` - Depends on `arrow-adbc` via vcpkg with custom overlay ports in `vcpkg-overlay/`
59103

60-
The extension currently registers a scalar function `adbc(varchar) -> varchar`. The ADBC driver manager is linked statically via `AdbcDriverManager::adbc_driver_manager_static`.
104+
The ADBC driver manager is linked statically via `AdbcDriverManager::adbc_driver_manager_static`.
61105

62106
## DuckDB Version
63107

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2018-2025 Stichting DuckDB Foundation
1+
Copyright 2025 - Query.Farm LLC ([email protected]) https://query.farm
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
44

0 commit comments

Comments
 (0)