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
Also having a similar issue, as above, tried aliasing to no avail.
Version
v1.27.0
Relevant log output
line 71:2 no viable alternative at input 'UPDATE\n\tEvents AS e\nSET\n\te.'
line 78:3 no viable alternative at input 'Entries'
# package models
sql/queries/events.sql:1:1: no viable alternative at input 'Entries'
Database schema
-- +goose UpCREATETABLEIF NOT EXISTS Events (
Id INTEGERPRIMARY KEY,
Name TEXTNOT NULL,
Description TEXTNOT NULL,
Visible INTEGERNOT NULL DEFAULT (1) CHECK (Visible IN (0, 1)),
Location TEXTREFERENCES Locations(Name),
EventDateTime INTEGERNOT NULLCHECK (EventDateTime > strftime('%s', 'now')),
CreatedAt INTEGERNOT NULL DEFAULT (strftime('%s', 'now')),
UpdatedAt INTEGER
) STRICT;
-- +goose UpCREATETABLEIF NOT EXISTS Entries (
Id INTEGERPRIMARY KEY,
Name TEXTNOT NULL,
Description TEXT,
UserId TEXTNOT NULLREFERENCES Users(Id) ON DELETE CASCADE,
EventId INTEGERNOT NULLREFERENCES Events(Id) ON DELETE CASCADE,
Category TEXTNOT NULLREFERENCES Categories(Name) ON DELETE CASCADE,
Score INTEGERCHECK (Score BETWEEN 0AND10),
CreatedAt INTEGERNOT NULL DEFAULT (strftime('%s', 'now')),
UpdatedAt INTEGER
) STRICT;
SQL queries
-- name: ToggleEventVisibility :oneUPDATE
Events AS e
SETe.Visible=1-e.VisibleWHEREe.Id= ? ANDe.Id NOT IN (
SELECT DISTINCTt.EventIdFROM
Entries AS t
)
RETURNING
COUNT(*);
Version
1.27.0
What happened?
sqlc fails to parse UPDATE statements that include both RETURNING and ORDER BY / LIMIT clauses.
Relevant log output
Database schema
SQL queries
Configuration
Playground URL
https://play.sqlc.dev/p/aef8481b79a2285af6ed4f04d801f0f59201be3ffce00df2bef824421bed477f
What operating system are you using?
Linux
What database engines are you using?
SQLite
What type of code are you generating?
Go
The text was updated successfully, but these errors were encountered: