Skip to content

feat(plugin): sql plugin support DuckDB#3946

Open
L-607 wants to merge 1 commit intolf-edge:masterfrom
L-607:duckdb
Open

feat(plugin): sql plugin support DuckDB#3946
L-607 wants to merge 1 commit intolf-edge:masterfrom
L-607:duckdb

Conversation

@L-607
Copy link
Copy Markdown
Contributor

@L-607 L-607 commented Dec 11, 2025

No description provided.

Copilot AI review requested due to automatic review settings December 11, 2025 07:52
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.3 dependency to go.mod
  • Creates a new DuckDB driver file following the established pattern for SQL database drivers
  • Uses the !no_base build 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
Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build (!no_base || duckdb) && !no_duckdb
Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build (!no_base || duckdb) && !no_duckdb
Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@ngjaying
Copy link
Copy Markdown
Collaborator

go.sum should be committed alongside go.mod updates.

@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.54%. Comparing base (e0c99ec) to head (c2ed04a).
⚠️ Report is 7 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ngjaying
Copy link
Copy Markdown
Collaborator

@L-607 Looks like some dependency needs to be installed to build in this DuckDB driver. Check the build package failures.

@L-607
Copy link
Copy Markdown
Contributor Author

L-607 commented Dec 18, 2025

@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.
https://github.com/lf-edge/ekuiper/tree/master/.github/dockerfile

@L-607 L-607 force-pushed the duckdb branch 4 times, most recently from 3c6dee8 to dd875bf Compare December 23, 2025 10:23
Signed-off-by: L-607 <i@1l.fit>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants