sqlc icon indicating copy to clipboard operation
sqlc copied to clipboard

Issues with parsing function syntax in MySQL

Open rzseattle opened this issue 1 year ago • 0 comments

Version

1.26.0

What happened?

Parse query file without errors and generate proper structure

Relevant log output

2024/05/29 11:55:18 dolphin.convert: Unknown node type *ast.TrimDirectionExpr
# package 
query.sql:2:12: function trim(unknown, unknown, unknown) does not exist

Database schema

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

SQL queries

SELECT id, trim(LEADING '0' FROM trim(name)) as name FROM authors

Configuration

{
  "version": "2",
  "sql": [{
    "schema": "schema.sql",
    "queries": "query.sql",
    "engine": "mysql",
    "gen": {
      "go": {
        "out": "db"
      }
    }
  }]
}

Playground URL

No response

What operating system are you using?

No response

What database engines are you using?

No response

What type of code are you generating?

No response

rzseattle avatar May 29 '24 11:05 rzseattle