marcboeker / go-duckdb

go-duckdb provides a database/sql driver for the DuckDB database engine.
MIT License
623 stars 97 forks source link

Set duckdb_api config option #149

Closed elefeint closed 7 months ago

elefeint commented 7 months ago

DuckDB 0.9.2 introduced PRAGMA USER_AGENT consisting of the surface API (duckdb_api) and a composable custom_user_agent.

This PR sets duckdb_api to go. And since config is now always passed when opening the database, it actually deletes more code than it adds!

marcboeker commented 7 months ago

@elefeint Thanks for the PR and the refactoring. Just because I'm curious: what is the idea behind setting the duckdb_api identifier?

elefeint commented 7 months ago

It allows analysis of which surfaces of DuckDB are used. Without it, go-duckdb usage is indistinguishable from other "C api" usage.