rphlmr ⚡
DTDrizzle Team
•Created by lauti on 11/4/2024 in #help
Cannot read properties of undefined (reading 'endsWith')
What's in your drizzle.config is only for drizzle-kit (push, pull, migrate, introspect). This one needs to be on 5432.
___
For your app, your
drizzle()
client, it depends on your production platform.
For example, port 6543
doesn't allow prepared
queries and requires pg
or postgres
drivers to disable this feature. But this is the go to for serverless target (vercel, azure function, etc).
If you deploy on Fly.io or Digital Ocean long running server, you can choose 5432.
(https://supabase.com/docs/guides/database/connecting-to-postgres#connecting-to-external-libraries-and-tools)49 replies
DTDrizzle Team
•Created by lauti on 11/4/2024 in #help
Cannot read properties of undefined (reading 'endsWith')
I would suggest adding another environment to your project just for drizzle.config. For your app, use what is best depending on your server.
49 replies
DTDrizzle Team
•Created by lauti on 11/4/2024 in #help
Cannot read properties of undefined (reading 'endsWith')
49 replies
DTDrizzle Team
•Created by lauti on 11/4/2024 in #help
Cannot read properties of undefined (reading 'endsWith')
Then you copy this string. It should be the same as your previous string, only the port changes.
49 replies
DTDrizzle Team
•Created by lauti on 11/4/2024 in #help
Cannot read properties of undefined (reading 'endsWith')
49 replies
DTDrizzle Team
•Created by lauti on 11/4/2024 in #help
Cannot read properties of undefined (reading 'endsWith')
postgresql://postgres:[YOUR-PASSWORD]@db.[PROJECT-ID].supabase.co:5432/postgres
49 replies
DTDrizzle Team
•Created by lauti on 11/4/2024 in #help
Cannot read properties of undefined (reading 'endsWith')
I would even advise using a direct connection for migrations/push, etc.
49 replies
DTDrizzle Team
•Created by lauti on 11/4/2024 in #help
Cannot read properties of undefined (reading 'endsWith')
6543 is a Supabase thing with Supavisor (their pooler)
49 replies
DTDrizzle Team
•Created by lauti on 11/4/2024 in #help
Cannot read properties of undefined (reading 'endsWith')
Because 6543 is a special mode for serverless (client open and close a connection on each transactions) and 5432 is a "stable" connection
49 replies
DTDrizzle Team
•Created by lauti on 11/4/2024 in #help
Cannot read properties of undefined (reading 'endsWith')
You can have an 'env' you use only in your Drizzle config (I have
MIGRATION_DATABASE_URL
with the connection string using port 5432
).49 replies
DTDrizzle Team
•Created by lauti on 11/4/2024 in #help
Cannot read properties of undefined (reading 'endsWith')
can you try with
5432
(session mode)49 replies
DTDrizzle Team
•Created by lauti on 11/4/2024 in #help
Cannot read properties of undefined (reading 'endsWith')
@lauti does your connection string uses the port
6543
? (Supabase Transaction mode)49 replies
DTDrizzle Team
•Created by lauti on 11/4/2024 in #help
Cannot read properties of undefined (reading 'endsWith')
ok I know why now
49 replies
DTDrizzle Team
•Created by lauti on 11/4/2024 in #help
Cannot read properties of undefined (reading 'endsWith')
Hello 👋 I can find where it happens in drizzle-kit.
@Andrew Sherman it's on
defaultForColumn
in pgSerializer
.
We are testing for column.column_default === null
but it doesn't catch undefined
(should be column.column_default == null
)49 replies
DTDrizzle Team
•Created by Anshul on 11/4/2024 in #help
How to select a subset of fields from a JSONB?
->
=> get the value
->>
=> get the value as string17 replies
DTDrizzle Team
•Created by Anshul on 11/4/2024 in #help
How to select a subset of fields from a JSONB?
note de
()
and the string interpolation on your table.field
17 replies
DTDrizzle Team
•Created by Anshul on 11/4/2024 in #help
How to select a subset of fields from a JSONB?
here an example: https://drizzle.run/wgnd28shd0f8hpmhyxnpisew
17 replies
DTDrizzle Team
•Created by Anshul on 11/4/2024 in #help
How to select a subset of fields from a JSONB?
hey sorry it was bed time for me 😄
17 replies
DTDrizzle Team
•Created by jorge on 8/11/2024 in #help
drizzle-zod createInsertSchema gives optional types
No prob 🫡 and welcome!
8 replies
DTDrizzle Team
•Created by jorge on 8/11/2024 in #help
drizzle-zod createInsertSchema gives optional types
We are tracking every GitHub report to update the documentation. Depending on which template or framework you use, there are many different configurations.
8 replies