Skip to content

sqlc compile does not report issues in sql files #3703

Open
@zbelial

Description

@zbelial

Version

1.27.0

What happened?

I wanted to use sqlc compile to check sql syntax errors, but I didn't get what I expected.

The following schema and queries were copied from sqlc document to used for testing.

Could you please help me figure out where the problem was? thanks.

Relevant log output

nothing

Database schema

CREATE TABLE authors (
  id   BIGINT  NOT NULL AUTO_INCREMENT PRIMARY KEY,
  name text    NOT NULL,
  bio  text
);

SQL queries

-- name: GetAuthor :one
SELECT * FROM authors
WHERE id = ? LIMIT 1;

-- name: ListAuthors :many
SELECT * FROM authors
ORDER BY name;

-- name: CreateAuthor :execresult
INSERT INTO authors (
  name, bio
) VALUES (
  ?, ?
);

-- name: DeleteAuthor :exec
DELETE FROM authors
WHERE id = ?;

Configuration

version: "2"
sql:
  - engine: "postgresql"
    queries: "query-pg.sql"
    schema: "schema-pg.sql"

Playground URL

No response

What operating system are you using?

Linux

What database engines are you using?

PostgreSQL

What type of code are you generating?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions