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 = ?;
I'm not able to reproduce this behavior. I added your query to the playground and I'm seeing the created_at and updated_at values being scanned correctly.
Version
1.18.0
What happened?
I get no results when using
created_at
orupdated_at
columns in SELECT statement. If i leave out the two columns then i get the expected results. I've run the query includingcreated_at
andupdated_at
using DBeaver and it works correctly.Relevant log output
No response
Database schema
SQL queries
Configuration
Playground 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