Open serhii-kucherenko opened 1 month ago
can you please share a pg dump without data?
can you please share a pg dump without data?
@AlexBlokh can I email it to you? Don't want to share it here
Providing more context because this is not supabase specific. In my case it's PostgreSQL. A simple repro:
Those DDL statements
CREATE SEQUENCE IF NOT EXISTS public.test_table_id_seq
INCREMENT 1
START 1
MINVALUE 1
MAXVALUE 9223372036854775807
CACHE 1;
CREATE TABLE test_table
(
id bigint NOT NULL DEFAULT nextval('test_table_id_seq'::regclass),
case_insensitive_name citext,
price money
);
are introspected to
export const testTable = pgTable("test_table", {
// You can use { mode: "bigint" } if numbers are exceeding js number limitations
id: bigint("id", { mode: "number" }).default(nextval('test_table_id_seq'::regclass)).notNull(),
// TODO: failed to parse database type 'citext'
caseInsensitiveName: unknown("case_insensitive_name"),
// TODO: failed to parse database type 'money'
price: unknown("price"),
});
It's clear that default value for id
column should be sql-quoted and citext
and money
types are "unknown".
citext
is from extension so that's kind of understandable.
money
though is a built-in type for PostgreSQL.
My env:
"drizzle-kit": "0.22.1",
"drizzle-orm": "0.31.0",
"ts-node": "10.9.2",
"typescript": "5.4.5"
Looks like this might be the same issue https://github.com/drizzle-team/drizzle-kit-mirror/issues/441 nextval
is not getting wrapped correctly with sql
I generated schema from the existing supabase and got a lot of unknown functions that I assume should be different or at least auto-imported from zod (for example). It's a HUGE blocker to proceed with the drizzle further for my project. Let me know if you can help me. Thanks.
Schreenshots
Dependencies