Skip to content

sqlite: Quoted tables generate invalid code #2311

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kyleconroy opened this issue Jun 7, 2023 · 1 comment
Closed

sqlite: Quoted tables generate invalid code #2311

kyleconroy opened this issue Jun 7, 2023 · 1 comment

Comments

@kyleconroy
Copy link
Collaborator

kyleconroy commented Jun 7, 2023

Version

v1.18.0

What happened?

Queries on tables with dashes (and other characters that require quotes) generates invalid Go code.

Relevant log output

sqlc generate failed.

# package db
error generating code: source error: 20:6: expected 'IDENT', found "Foo-Bar"

Database schema

CREATE TABLE "foo-bar" (
  name text      NOT NULL
);

SQL queries

-- name: ListFooBar :many
SELECT * FROM "foo-bar";

Configuration

{
  "version": "1",
  "packages": [
    {
      "path": "db",
      "engine": "sqlite",
      "schema": "query.sql",
      "queries": "query.sql"
    }
  ]
}

Playground URL

https://play.sqlc.dev/p/d99fe3b457f038006ef8c8c29b22c60edab178dc9e83e5cddac4408c9cbe696c

What operating system are you using?

macOS

What database engines are you using?

SQLite

What type of code are you generating?

Go

@kyleconroy kyleconroy added bug Something isn't working triage New issues that hasn't been reviewed 🔧 golang 💻 darwin 📚 sqlite and removed triage New issues that hasn't been reviewed labels Jun 7, 2023
@kyleconroy
Copy link
Collaborator Author

Duplicate of #1817

@kyleconroy kyleconroy marked this as a duplicate of #1817 Jul 31, 2023
@kyleconroy kyleconroy closed this as not planned Won't fix, can't repro, duplicate, stale Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant