sqlc icon indicating copy to clipboard operation
sqlc copied to clipboard

No support for column names containing a colon

Open vidarlx opened this issue 4 years ago • 0 comments

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

vidarlx avatar Mar 29 '21 16:03 vidarlx