DT
Drizzle TeamTAINCER
Use schema definition as normal types
I want to use my schema definition as a normal type. Basically what .select().from() returns - plain object with the type.
I need it for something like this:
const result = (await fetch("http://127.0.0.1:8000")).json() as Promise<typeof my_schema[]>;
I could of course define a type with the same schema as my db schema but then I have to update that whenever I update my schema, is there a better way?Kasper•28d ago
Do you mean like this?
TAINCER•26d ago
Yes, thanks alot!
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
7.4KMembers
View on DiscordWant results from more Discord servers?
More PostsWhat is a recommended way to execute migration on CI ?Build facilities for migration assume it happens during app execution I don't sure it a good idea anStruggling when changing tables relationships or columnsI find myself getting errors such as quite regularly
[cause]: [ResponseError: SQLite error: no suchHow can I get rid of the buffer object returned when using Magical sql operator?This is and example of how I execute the query:
```ts
const id = 69;
await db.execute(sql`select * fField 'email' doesn't have a default with connection pool in MySQL```
[next-auth][error][adapter_error_createUser]
https://next-auth.js.org/errors#adapter_error_creatabje.js exports not defined in table.d.tsIs there any reason why the table.d.ts is not matching with the table.js file?
table.js has these exHow not to exceed the max connections limit in the DB in a Serverless env like AWS lambda?[question] What is the recommended way to use drizzle in a serverless environment like AWS lambda -