Generated SQL error / type error with operations on unique index

Just jotting this down so i dont forget sqlite here
Argument of type 'SQL<unknown> | undefined' is not assignable to parameter of type 'SQL<unknown>'.
Type 'undefined' is not assignable to type 'SQL<unknown>'.ts(2345)
Argument of type 'SQL<unknown> | undefined' is not assignable to parameter of type 'SQL<unknown>'.
Type 'undefined' is not assignable to type 'SQL<unknown>'.ts(2345)
When running push
CREATE UNIQUE INDEX `county_state_unique_idx` ON `locations` (`full_county_name`,`state_code`);
CREATE UNIQUE INDEX `state_unique_idx` ON `locations` (`state_code`) WHERE ("locations"."full_county_name" is null and "locations"."type" = 'state');
CREATE UNIQUE INDEX `county_state_unique_idx` ON `locations` (`full_county_name`,`state_code`);
CREATE UNIQUE INDEX `state_unique_idx` ON `locations` (`state_code`) WHERE ("locations"."full_county_name" is null and "locations"."type" = 'state');
In order to get this working i had to use sql. If you don't and use eq(t.type) = 'state it genereates
WHERE ("crexi_locations"."full_county_name" is null and "locations"."type" = ?);
WHERE ("crexi_locations"."full_county_name" is null and "locations"."type" = ?);
No description
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server