Skip to content

No support for column names containing a colon #957

Open
@vidarlx

Description

@vidarlx

Syntax error is being thrown when there is a column containing colon, which is a valid SQL syntax, for example

CREATE TABLE authors (
  id   BIGSERIAL PRIMARY KEY,
  name text      NOT NULL,
  bio  text,
  "sar:test" text
);
sqlc generate failed.
# package db
query.sql:10:1: edited query syntax is invalid: syntax error at or near ":"
query.sql:14:1: edited query syntax is invalid: syntax error at or near ":"
query.sql:18:1: edited query syntax is invalid: syntax error at or near ":"

I'm using postgresql engine.

I tried to rename struct fields, but it doesn't make the issue go away. Any clue how to cope with that?

Thanks!

Playground

https://play.sqlc.dev/p/2059cf438de741f4a73ea28b5373010384f38f3cda17a4d6c568a7b0ad219f3e

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