Tip
If you already have a DuckDB Quack server instance running, skip the steps to set up DuckDB.
-
Start the DuckDB CLI:
duckdb
-
Create a table:
CREATE TABLE penguins AS FROM read_csv('https://blobs.duckdb.org/data/penguins.csv', nullstr = 'NA');
-
Start a server from the DuckDB session:
CALL quack_serve('quack:localhost');Note the
auth_tokenvalue that DuckDB prints.
-
Install the Quack ADBC driver:
dbc install --pre quack
-
Customize the Go program
main.goas needed- Change the
uriconnection argument- Replace
YOUR_AUTH_TOKENwith theauth_tokenprinted by DuckDB - Change the host and port if applicable
- Replace
- If you changed which database you're connecting to, also change the SQL SELECT statement in
stmt.SetSqlQuery()
- Change the
-
Run the Go program:
go mod tidy go run main.go
If you started a DuckDB server, exit the DuckDB CLI:
.exit