Having Issues Pushing Database Schema
Hi I am getting this issue whenever I am trying to push the database schema. Any help would be greatly appreciated.
Noahh•247d ago
Can you share your
drizzle.config
file?Fil•247d ago
Noahh•247d ago
Configuring Drizzle kit - DrizzleORM
Drizzle ORM | %s
Noahh•247d ago
As seen here: https://orm.drizzle.team/kit-docs/conf#push-and-pull
Configuration files - DrizzleORM
Drizzle ORM | %s
Fil•247d ago
Sorry I am a little bit confused. THe config file is it supposed to point to the schema and index.ts?
Noahh•247d ago
The config file helps Drizzle Kit commands run. So, when you
pnpm drizzle-kit generate:pg
, it needs to know
1. where you schema files are so it can run them
2. where you want your SQL files to output
with push
, it needs to know the same information, but it also needs to know what driver you're using (pg, mysql2, etc.), as well as your connection string so it can properly connect to the database and apply the migrationsFil•247d ago
I am using Nextjs and I am trying to settup the connection for planetscale
Noahh•247d ago
yep, so since Planetscale is mysql, I believe you need to use the
mysql2
driver
(never worked with planetscale or mysql with drizzle so i'm just assuming, it doesn't seem like there is a planetscale driver specifically)Fil•247d ago
Okay I found out the issue, I moved my drizzle.config.ts to the right folder
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 Postsmigration failedcode:
```js
const migrationClient = postgres("postgresql://jer:admin@localhost:5432/test", { max: 1TypeError: Cannot read properties of undefined (reading 'compositePrimaryKeys')I am attempting to run db push, but I am getting this error above^^
does anyone know what might be Nesting sqlite drizzle into a deeper location in my ts app, difficulties with src/ vs dist/Hey! I'm very new to drizzle and trying to set up a very small drizzle instance for a service that rsyntax highlighting not workingI reinstalled the node_modules multiple times and it didnt fix my problem. This isnt suposed to lookPrepare raw sql query (Postgres)Hi, I need to do a recursive query, so I think I need to use the magic sql operator to build it. Is packing migration files with the libraryhey there, I'm trying to use `migrate` inside from a library consumer (i.e I have a `@mycompany/db-lAny way to invoke a SQL function?For ex: lets say I declare a SQL function `CREATE OR REPLACE FUNCTION do_something()`
how do i invoHow to include array literals in raw sql?I have an input array used for an order by using the array_position function - rather than passing tMySQL Table SchemasI need to generate the following structure of tables:
`1. Sales
2.Sales
....`
Currently if I use wany way to automatically cast numeric types on retrieval?I have a numeric field in a video table:
```
export const VideoTable = pgTable('videos', {
id: uuiQuery in drizzle doesn't work## Error:
```console
DrizzleError: No fields selected for table "usersToGroups" ("users_groups")
``Cannot read properties of undefined (reading 'referencedTable')Seemingly getting this error out of nowhere. I believe it's related to the relations I defined, but Relational query builder in mysql?I cant find anything about how to implement this. Am I blind or is this impossible?TransactionRollbackErrorNeed some help understanding TransactionRollbackError...
Is this error saying the `tx.rollback()` fPostgresError: null value in column "id" of relation "pairs" violates not-null constraintHello, I am fairly new to Drizzle and working with databases, so I am running into a problem that I OnConflictDoNothing with mysqlHi everyone,
I want to use the on conflict do nothing method described here: https://orm.drizzle.teadrizzle-kit introspect reorder tablesHere is the case:
- I have a remote database. I made a backup and restore it locally
- I ran: drizzMigration custom loggerHey there, I'm want to run migration as part of my CI/CD, and would have liked the output of the `miwhy do snapshots not have the same name as the migrations?Hey, loving dirzzle so far.
Hit a snag recently. Me and my friend are collaborating on a project. Help with improving database queryHello, I am seeking advice on how to improve a database query I am currently working with. My object