You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to run the sqlc generate and one of the query in the file I have is as below
WITH update_namespaces AS (
UPDATE namespaces
SET name = COALESCE(sqlc.narg('name'), name),
updated_at = COALESCE(sqlc.narg('updated_at'), updated_at),
updated_by = COALESCE(sqlc.narg('updated_by'), updated_by)
WHEREnamespaces.id=sqlc.arg('id')
RETURNING *
),
update_properties AS (
UPDATE namespaces_properties
SET allow_content_deletion = COALESCE(sqlc.narg('allow_content_deletion'), allow_content_deletion)
WHERE namespace_id =sqlc.arg('id')
RETURNING *
),
update_emergency_contacts AS (
UPDATE namespaces_emergency_contacts
SET email = COALESCE(sqlc.narg('emergency_email'), email),
public_slack_channel = COALESCE(sqlc.narg('public_slack_channel'), public_slack_channel),
public_slack_channel_id = COALESCE(sqlc.narg('public_slack_channel_id'), public_slack_channel_id),
slack_group = COALESCE(sqlc.narg('slack_group'), slack_group)
WHERE namespace_id =sqlc.arg('id')
RETURNING *
),
delete_existing_locales AS (
DELETEFROM namespaces_locales
WHERE namespace_id =sqlc.arg('id')
RETURNING *
),
insert_new_locales AS (
INSERT INTO namespaces_locales (namespace_id, locale_id)
SELECTsqlc.arg('id'), unnest(sqlc.arg('locales')::text[])
ON CONFLICT (namespace_id, locale_id) DO NOTHING
RETURNING *
),
delete_existing_components AS (
DELETEFROM namespaces_components
WHERE namespace_id =sqlc.arg('id')
RETURNING *
),
insert_new_components AS (
INSERT INTO namespaces_components (namespace_id, component_id)
SELECTsqlc.arg('id'), unnest(sqlc.arg('components')::text[])
ON CONFLICT (namespace_id, component_id) DO NOTHING
RETURNING *
)
SELECT
(SELECTCOUNT(*) FROM update_namespaces) AS UpdatedNamespaces,
(SELECTCOUNT(*) FROM update_properties) AS UpdatedProperties,
(SELECTCOUNT(*) FROM update_emergency_contacts) AS UpdatedEmergencyContacts,
(SELECTCOUNT(*) FROM delete_existing_locales) AS DeletedLocales,
(SELECTCOUNT(*) FROM insert_new_locales) AS InsertedLocales,
(SELECTCOUNT(*) FROM delete_existing_components) AS DeletedComponents,
(SELECTCOUNT(*) FROM insert_new_components) AS InsertedComponents;\
It throws an error saying that the allow_content_deletion field doesn't exist, where as it does exist. Any idea why? Also if I swap the update_properties and update_emergency_contacts section the error points saying email field doesn't exist which his the first column after SET.
The text was updated successfully, but these errors were encountered:
I am trying to run the
sqlc generate
and one of the query in the file I have is as belowIt throws an error saying that the
allow_content_deletion
field doesn't exist, where as it does exist. Any idea why? Also if I swap theupdate_properties
andupdate_emergency_contacts
section the error points sayingemail
field doesn't exist which his the first column after SET.The text was updated successfully, but these errors were encountered: