-
Notifications
You must be signed in to change notification settings - Fork 968
Closed
Labels
📚 mysql💻 linux🔧 golangbugSomething isn't workingSomething isn't workingquestionFurther information is requestedFurther information is requested
Description
Version
1.18.0
What happened?
I get no results when using created_at or updated_at columns in SELECT statement. If i leave out the two columns then i get the expected results.
I've run the query including created_at and updated_at using DBeaver and it works correctly.
Relevant log output
No response
Database schema
CREATE TABLE jobs (
id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
template_id BIGINT NOT NULL,
status INT NOT NULL DEFAULT 1,
report json,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (template_id) REFERENCES job_templates(id)
);SQL queries
-- name: ListJobs :many
SELECT
j.id,
j.status,
j.created_at,
j.updated_at,
jt.external_ref,
jt.url,
jt.job_schema,
p.common_name as provider_name
FROM
jobs j
INNER JOIN job_templates jt ON j.template_id = jt.id
INNER JOIN providers p ON jt.provider_id = p.id
WHERE
j.status = ?;Configuration
version: "1"
packages:
- name: "mysql"
path: "."
queries: "./query/"
schema: "../../db/migrations/"
engine: "mysql"
emit_json_tags: false
emit_db_tags: false
emit_prepared_queries: false
emit_interface: false
emit_exact_table_names: true
emit_empty_slices: truePlayground URL
https://play.sqlc.dev/p/383409dd75455f035516b8b5a44074ba4c8c06d46ba1149402d1817921364b09
What operating system are you using?
Linux
What database engines are you using?
MySQL
What type of code are you generating?
Go
Metadata
Metadata
Assignees
Labels
📚 mysql💻 linux🔧 golangbugSomething isn't workingSomething isn't workingquestionFurther information is requestedFurther information is requested