Skip to content

feat: add DEFAULT clause#4025

Open
Elia-Renzoni wants to merge 2 commits intolf-edge:masterfrom
Elia-Renzoni:sql-default
Open

feat: add DEFAULT clause#4025
Elia-Renzoni wants to merge 2 commits intolf-edge:masterfrom
Elia-Renzoni:sql-default

Conversation

@Elia-Renzoni
Copy link
Copy Markdown
Contributor

@Elia-Renzoni Elia-Renzoni commented Apr 14, 2026

@ngjaying
This PR introduces support for the DEFAULT clause. At the moment, the implementation covers only the following data types:

  • STRING
  • FLOAT
  • BOOLEAN
  • BIGINT

If this approach looks good to you, I can extend the support to all the other available data types.

From a design perspective, and to avoid large refactors, the DEFAULT clause is currently enabled only when STRICT_VALIDATION is set to true. This means the feature relies on the preprocessor to work properly.

Let me know your thoughts or if you'd like me to adjust anything.

Related Issue: #2293

@Elia-Renzoni
Copy link
Copy Markdown
Contributor Author

Elia-Renzoni commented Apr 14, 2026

There is a minor issue in the CI pipeline related to a unit test. However, it does not appear to be caused by the changes in this PR. I ran the same codebase without my modifications and the error is still reproducible, so we can conclude that it is unrelated to this change?

Let me know if you already have context on it.

Signed-off-by: Elia Renzoni <elia.renzoni03@gmail.com>
Signed-off-by: Elia Renzoni <elia.renzoni03@gmail.com>
@Elia-Renzoni Elia-Renzoni changed the title feat: add default clause feat: add DEFAULT clause Apr 23, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

❌ Patch coverage is 60.00000% with 54 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.66%. Comparing base (1c2f927) to head (d655909).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
pkg/ast/sourceStmt.go 48.24% 44 Missing ⚠️
internal/xsql/parser.go 70.83% 6 Missing and 1 partial ⚠️
internal/processor/stream.go 76.92% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4025      +/-   ##
==========================================
+ Coverage   70.63%   70.66%   +0.02%     
==========================================
  Files         459      459              
  Lines       53324    53449     +125     
==========================================
+ Hits        37665    37765     +100     
- Misses      12719    12749      +30     
+ Partials     2940     2935       -5     

☔ 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.

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.

1 participant