Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions internal/core/analyzer/expr.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ func (a *analyzer) typeExpr(n ast.Node) (exprType, error) {
return exprType{}, nil

case *ast.TODO:
if e.UnsupportedFeature != "" {
return exprType{}, fmt.Errorf("%s is not supported", e.UnsupportedFeature)
}
return exprType{}, nil

case *ast.A_Const:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"command": "analyze",
"args": ["--dialect", "duckdb", "--schema", "schema.sql", "query.sql"],
"contexts": ["base"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- name: PublicPeople :many
SELECT * EXCLUDE (secret) FROM people;

-- name: RenumberedPeople :many
SELECT * REPLACE (id + 1 AS id) FROM people;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE TABLE people (id INTEGER, name VARCHAR, secret VARCHAR);
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Error: error parsing queries: query.sql:1:1: DuckDB star expression with modifiers or COLUMNS is not supported; query.sql:5:1: DuckDB star expression with modifiers or COLUMNS is not supported
2 changes: 1 addition & 1 deletion internal/engine/duckdb/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ func (c *cc) convertStar(e *dw.StarExpression) ast.Node {
// COLUMNS(...) and EXCLUDE/REPLACE/RENAME modifiers have no equivalent.
if e.Columns || e.Expr != nil || len(e.ExcludeList) > 0 ||
len(e.QualifiedExcludeList) > 0 || len(e.ReplaceList) > 0 || len(e.RenameList) > 0 {
return todo(e)
return &ast.TODO{UnsupportedFeature: "DuckDB star expression with modifiers or COLUMNS"}
}
fields := &ast.List{}
if e.RelationName != "" {
Expand Down
3 changes: 2 additions & 1 deletion internal/sql/ast/todo.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package ast

type TODO struct {
Tag NodeTag[TODO] `json:"tag"`
Tag NodeTag[TODO] `json:"tag"`
UnsupportedFeature string `json:"unsupportedFeature,omitempty"`
}

func (n *TODO) Pos() int {
Expand Down
Loading