-
Notifications
You must be signed in to change notification settings - Fork 978
Closed
Labels
📚 postgresqlbugSomething isn't workingSomething isn't workingupstreamIssue is caused by a dependencyIssue is caused by a dependency
Description
If you forget to end a query with a semicolon you get:
-- Example queries for sqlc
CREATE TABLE authors (
id BIGSERIAL PRIMARY KEY,
name text NOT NULL,
bio text
);
-- name: GetAuthor :one
SELECT * FROM authors
WHERE id = $1 LIMIT 1;
-- name: ListAuthors :many
SELECT * FROM authors
ORDER BY name
-- name: CreateAuthor :one
INSERT INTO authors (
name, bio
) VALUES (
$1, $2
)
RETURNING *;
-- name: DeleteAuthor :exec
DELETE FROM authors
WHERE id = $1;# package querytest
query.sql:1:1: syntax error at or near "INSERT"
Which is confusing because I start looking at the next query instead of the one above it, and the 1:1 makes me think it's at the beginning of the file which it's not.
Maybe just append this error message with "add a semicolon"?
Metadata
Metadata
Assignees
Labels
📚 postgresqlbugSomething isn't workingSomething isn't workingupstreamIssue is caused by a dependencyIssue is caused by a dependency