feat(plugin): sql plugin support DuckDB#3946
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds DuckDB database support to the SQL plugin by introducing a new driver wrapper file and adding the DuckDB dependency to the project.
- Adds
github.com/duckdb/duckdb-go/v2 v2.5.3dependency to go.mod - Creates a new DuckDB driver file following the established pattern for SQL database drivers
- Uses the
!no_basebuild tag, making DuckDB a base driver included by default
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| go.mod | Adds the DuckDB driver dependency (v2.5.3) to support DuckDB database connectivity |
| extensions/impl/sql/sqldatabase/driver/duckdb.go | Introduces the DuckDB driver wrapper with build tags and blank import, following the same pattern as other base SQL drivers |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| //go:build (!no_base || duckdb) && !no_duckdb |
There was a problem hiding this comment.
The documentation for SQL source plugin (docs/en_US/guide/sources/plugin/sql.md line 14 and docs/zh_CN/guide/sources/plugin/sql.md line 13) states that the plugin supports sqlserver\postgres\mysql\sqlite3\oracle drivers by default. With the addition of DuckDB as a base driver (using the !no_base build tag), the documentation should be updated to include DuckDB in the list of default supported drivers.
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| //go:build (!no_base || duckdb) && !no_duckdb |
There was a problem hiding this comment.
The documentation for SQL sink plugin (docs/en_US/guide/sinks/plugin/sql.md line 10 and docs/zh_CN/guide/sinks/plugin/sql.md line 8) states that the plugin supports sqlserver\postgres\mysql\sqlite3\oracle drivers by default. With the addition of DuckDB as a base driver, the documentation should be updated to include DuckDB in the list of default supported drivers.
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| //go:build (!no_base || duckdb) && !no_duckdb |
There was a problem hiding this comment.
The SQL source plugin documentation (docs/en_US/guide/sources/plugin/sql.md line 82-87) includes a table showing URL samples for MySQL, SQL Server, Postgres, and SQLite. With DuckDB being added as a supported database, consider adding a DuckDB URL sample to this table to help users understand the connection string format for DuckDB.
|
go.sum should be committed alongside go.mod updates. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3946 +/- ##
==========================================
+ Coverage 71.50% 71.54% +0.04%
==========================================
Files 455 455
Lines 52308 52292 -16
==========================================
+ Hits 37401 37411 +10
+ Misses 11990 11970 -20
+ Partials 2917 2911 -6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@L-607 Looks like some dependency needs to be installed to build in this DuckDB driver. Check the build package failures. |
Looks like should add lib for debian and alpine,need to modify the Dockerfile; I'll try it. |
3c6dee8 to
dd875bf
Compare
Signed-off-by: L-607 <i@1l.fit>
No description provided.