Migration failure on fresh DB
Using Vercel Postgres and developing locally
drizzle
(and other platform specific stuff like
sql
) from
drizzle-orm/vercel-postgres
or
drizzle-orm/node-postgres
based on
NODE_ENV
?
I see the sample Next.js project has been updated for Vercel Postgres:
https://github.com/vercel/examples/blob/main/storage/postgres-drizzle/lib/drizzle.ts
...
Custom Type interpreted as String
Can I use queryBuilder for inserts?
queryBuilder
(
https://github.com/drizzle-team/drizzle-orm/blob/main/drizzle-orm/src/pg-core/README.md#query-builder
) since I wouldn't need to connect to a DB to generate the SQL queries, but seems like
queryBuilder
only supports
select()
at the moment. Do I need to connect to a local DB if I want to generate
insert()
queries?
I ran introspect:pg to initialize my schema, then created a new migration. How should I deploy this?
drizzle.__drizzle_migrations
table. It'd be nice to have a way to know that the old migrations - the ones that were generated by introspect:pg and just reflect the existing state of the database - won't run. Is this the right way to look at it? Thanks!
Transaction rollback
error creating relationship
npx drizzle-kit push:mysql
but the I'm trying running the code inside my MySQL database but I'm getting this error
Referencing column 'user_id' and referenced column 'id' in foreign key constraint 'anime_user_id_users_id_fk' are incompatible.
here is the schema and the generated SQL migration code.
```javascript
export const users = mysqlTable(
"users",...
define default value for array
TS query types dont match + no return types
const data = await db.select().from(Item)
As you can see in the screenshot and the error message below typescript seems to have trouble with that.
Item
table definition is being imported from another typescript project within the repo which might have to do with it?
...
Can't generate migrations because of top level await
drizzle.config.json
:
```{ "out": "./migrations", "schema": "./src/* / .sql.ts" }...
Error types with custom schema
Trying to write next-auth adapter
nothing to migrate
and, when I run tests against my
db.sqlite
, I get back errors for
no tables, kiddo
. Pretty confused; seems like I'm not pushing any schema somehow?
Pull request if you want to look at code:
https://github.com/nextauthjs/next-auth/pull/7165
...
Been getting this error while using the libsql client. The code works though. Any ideas. Thanks! 🙂
Select wildcard
.select()
wildcard so that I can do something like:
```ts
db.select((defaultFields) => ({...
RangeError: Maximum call stack size exceeded - When I try to INSERT
RangeError: Maximum call stack size exceeded
when I try to INSERT something in the DB, SELECT queries works with no issues.
I am using
"drizzle-orm": "^0.25.3"
and
"@remix-run/react": "^1.15.0"
....
Tables are not being generated
Inserting records into related tables