What's the correct type to use for an update function?
I'm trying to do a simple function where I update a record in a table:
```ts
import { NewVideo, VideoTable } from '~/db/schema/video';
...
Studio with AWS Data API?
Is it possible to use Drizzle Studio with the AWS Data API, seeing as it doesn't have a true connection string (from what I understand).
Deferrable foreign key constraints
Hi, does anyone know a way to declare deferrable foreign key constraints when defining a Postgres table using
pgTable
, and a way to issue SET CONSTRAINTS
within a transaction when querying in Drizzle? Thanks!
https://www.postgresql.org/docs/current/sql-set-constraints.html...Turso with Cloudflare Pages
I would like to use Drizzle, Turso and Cloudflare Pages but Drizzle does not support
@libsql/client/web
is there any way to do it ?
Thanks you.
https://docs.turso.tech/reference/client-access/javascript-typescript-sdk...In memory tests with libsql?
Do you guys know if there's a way to get this working with libsql?
I'm using turso, and was hoping to get the DB working in memory for local tests.
I have this...
Help with types in Repository Pattern
Hello,
I'm trying to set up a crud repository where it can be extended but I'm not sure how to get the typings correct.
Here is what I have and I'm stuck.
The issue that I have is I'm not sure how to actually get the primaryKey in a type safe way....
what do we need to pass in --ssl to enforce SSL?
I have a Supabase database where SSL has been enforce. But Drizzle fails to connect to DB giving local SSL certificate error. It works fine once I disable enforcement on Supabase side. I see there is a --ssl parameter in command line, but it does not do anything/I am missing something. Can anybody please help here?
Transforming SELECT from case to camelCase via sql with execute
I am getting some values for example
I wish to transform this with the AS keyword:...
comments.created_at,
comments.created_at,
How drizzle handle nulls and undefineds ?
I'm running this query, but some values in where clause are undefined, how do i make it optional ?
Error: UNDEFINED_VALUE: Undefined values are not allowed
query:...Relational queries result types are not working
Hi,
When i call findMany or findFirst with no args, the result type is
```
const trips: {...
defaultRandom() on uuid results in an error
id: uuid('id').unique().primaryKey().notNull().defaultRandom(),
id: uuid('id').unique().primaryKey().notNull().defaultRandom(),
Handling self referencing foreign keys
I have the following code but am getting an error that says
'people' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.ts(7022)
How should I handle a self referencing foreign key like in my example below?...
sqlite encode
I'm trying to encode some data in the schema.
I thought I could use the
sql
command, but I think that's only for doing default values
Like for this table:...Running local database with edge runtime on NextJS
Hi, I've been trying to run drizzle on /pages/api route (edge runtime) in NextJS but I can't get it to work locally. It feels like I've tried every combination of drivers so far but they either refuse to connect (neon and vercel/postgres for example does not like my connection string), complain about node modules or just doesn't seem to be able to fetch anything (seemingly connects but awaited queries do no not return). I have a postgres database that works with the node-postgres driver for trpc endpoints.
Any help is appreciated...
help with a generic mysql2 connection
gday folks, im trying to create what is essentially a generic mysql2 connection that is compatible with planetscale but also compatible with a local msyql2 server running in docker, for instance...my production database is planetscale hosted and any sort of dev or testing i want to do locally. My connection at the moment is literally just
drizzle(connection, { mode: DB_MODE, schema })
however due to the sheer amount of options within the configuration im concerned im missing something crucial for the continued integration with planetscale with such a minimal config. granted the port, user, password, schema, etc are all in the uri, but is there anything else i should be considering?...Select as db column names instead of js property names
Is there a helper to make select queries that return db column names, i.e. snake-cased instead of the camelCased schema names? I figure I can implement pretty easily, just wanted to know if there's already something provided by drizzle?
Unable to make migrations
Hey guys. I don't want to push it too hard, but am I the only one who stuck with this issue?
I can not downgrade drizzle kit (it throws error that package is outdated), and I basically can not apply any changes to database - it basically blocked any further development. Do you know any workaround for that, or at least the reason why It's happening?
I'm referring to https://github.com/drizzle-team/drizzle-orm/issues/1119...
where(gt) with timestamp returns wrong result
Might be a SQL inherent thing, but I'm a bit puzzled as to why this happens:
Edit: for terseness I left out some code. I think the issue is clear
```ts...