-
Notifications
You must be signed in to change notification settings - Fork 963
Closed
Labels
📚 mysqlbugSomething isn't workingSomething isn't workingupstreamIssue is caused by a dependencyIssue is caused by a dependency
Description
Version
1.10.0
What happened?
Hey all, thanks for this awesome library! Ran into some issues using expressions as default values in MySQL 8.
https://dev.mysql.com/doc/refman/8.0/en/data-type-defaults.html
I assume this may just be a feature missing from the upstream https://github.com/pingcap/parser library.
Figured I would raise this here to see if anyone is aware of a workaround.
Thanks again for all the hard work.
Relevant log output
# package auth
schema.sql:3:29: syntax error near "(UUID()) NOT NULL PRIMARY KEY"Database schema
CREATE TABLE IF NOT EXISTS organizations
(
id VARCHAR(36) DEFAULT (UUID()) NOT NULL PRIMARY KEY
);SQL queries
-- name: GetOrganization :one
SELECT * FROM organizations
WHERE id = ? LIMIT 1;Configuration
{
"version": "1",
"packages": [
{
"path": "db",
"engine": "mysql",
"schema": "query.sql",
"queries": "query.sql"
}
]
}Playground URL
https://play.sqlc.dev/p/8b99ca6623d728b89b335001bed9e38464a88572dbe2620456d1c3e37dcf5c67
What operating system are you using?
macOS
What database engines are you using?
MySQL
What type of code are you generating?
Go
Metadata
Metadata
Assignees
Labels
📚 mysqlbugSomething isn't workingSomething isn't workingupstreamIssue is caused by a dependencyIssue is caused by a dependency