-
Notifications
You must be signed in to change notification settings - Fork 967
Closed
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationinvalidThis doesn't seem rightThis doesn't seem right
Description
Version
1.12.0
What happened?
When I join two tables and try to select everything from only one of them using the generated code return only one item rather than a list.
Relevant log output
No response
Database schema
-- Example queries for sqlc
create table church_events
(
id bigserial
primary key,
created_at timestamp with time zone,
updated_at timestamp with time zone,
deleted_at timestamp with time zone,
organizer_id bigint not null
constraint fk_church_events_organizer
references users
on update cascade on delete set null,
cover_image text not null,
title text not null,
sub_title text not null,
content text not null,
scheduled_on timestamp with time zone not null,
age integer not null
);
create table church_jobs
(
duty text not null,
church_event_id bigint not null
constraint fk_church_event
references church_events
on update cascade on delete set null,
id bigserial
primary key,
created_at timestamp with time zone not null,,
updated_at timestamp with time zone,
deleted_at timestamp with time zone
);SQL queries
-- name: GetEvent :one
select *
from church_events
left join church_jobs cj on church_events.id = cj.church_event_id
where church_events.deleted_at IS NULL
AND church_events.id = $1;Configuration
{
"version": "1",
"packages": [
{
"path": "db",
"engine": "postgresql",
"schema": "query.sql",
"queries": "query.sql"
}
]
}Playground URL
https://play.sqlc.dev/p/751428fd61df6380a97a365d86e61818671ea15494a0df5cbf0d5b3ff7de48f0
What operating system are you using?
Linux
What database engines are you using?
PostgreSQL
What type of code are you generating?
Go
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationinvalidThis doesn't seem rightThis doesn't seem right