Skip to content
Merged
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
4 changes: 3 additions & 1 deletion internal/compiler/output_columns.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func (c *Compiler) outputColumns(qc *QueryCatalog, node ast.Node) ([]*Column, er
}
case *ast.CallStmt:
targets = &ast.List{}
case *ast.TruncateStmt, *ast.RefreshMatViewStmt:
case *ast.TruncateStmt, *ast.RefreshMatViewStmt, *ast.NotifyStmt, *ast.ListenStmt:
targets = &ast.List{}
case *ast.UpdateStmt:
targets = n.ReturningList
Expand Down Expand Up @@ -491,6 +491,8 @@ func (c *Compiler) sourceTables(qc *QueryCatalog, node ast.Node) ([]*Table, erro
}
case *ast.CallStmt:
list = &ast.List{}
case *ast.NotifyStmt, *ast.ListenStmt:
list = &ast.List{}
default:
return nil, fmt.Errorf("sourceTables: unsupported node type: %T", n)
}
Expand Down
2 changes: 2 additions & 0 deletions internal/compiler/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ func (c *Compiler) parseQuery(stmt ast.Node, src string, o opts.Parser) (*Query,
if err != nil {
return nil, err
}
case *ast.ListenStmt:
case *ast.NotifyStmt:
case *ast.TruncateStmt:
case *ast.UpdateStmt:
case *ast.RefreshMatViewStmt:
Expand Down
32 changes: 32 additions & 0 deletions internal/endtoend/testdata/notifylisten/postgresql/pgx/v5/go/db.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-- name: NotifyTest :exec
NOTIFY test;

-- name: NotifyWithMessage :exec
NOTIFY test, 'msg';

-- name: ListenTest :exec
LISTEN test;
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": "1",
"packages": [
{
"path": "go",
"engine": "postgresql",
"sql_package": "pgx/v5",
"name": "querytest",
"schema": "query.sql",
"queries": "query.sql",
}
]
}