sqlc
sqlc copied to clipboard
Missing check for update on PostgreSQL
The following query is compiled, although it should not, since the is_deleted column does not exist.
UPDATE
public.articles
SET
is_deleted = TRUE
WHERE
id = $1;
Schema:
CREATE TABLE public.articles (
id integer NOT NULL,
company integer NOT NULL,
name text NOT NULL,
sort_order integer DEFAULT 0 NOT NULL,
object_type smallint NOT NULL,
image text,
"group" integer,
notes text DEFAULT ''::text NOT NULL
);
I am using PostgreSQL 13.
https://play.sqlc.dev/p/3b7f89f370c2d2f1aff72fb0953a00d98d52ec2cc195d848dca81cacec4c3344