JohnAllen
JohnAllen
Explore posts from servers
DTDrizzle Team
Created by JohnAllen on 3/16/2024 in #help
introspect not finding tables for pg database
Hi all. Contributing to an OSS project https://github.com/codu-code/codu and we are migrating from prisma to drizzle. We have built the drizzle schema manually but its not 100% correct as we are having issues migrating some of our DB queries. Ideally we would like to have drizzle kit create the schema definition for us using
npx drizzle-kit introspect:pg
npx drizzle-kit introspect:pg
However when we run this, it ignores the tables and only pulls the enums from our PG DB and not the tables. This creates the following schema
import { pgTable } from "drizzle-orm/pg-core"
import { sql } from "drizzle-orm"

export const role = pgEnum("Role", ['MODERATOR', 'ADMIN', 'USER'])
import { pgTable } from "drizzle-orm/pg-core"
import { sql } from "drizzle-orm"

export const role = pgEnum("Role", ['MODERATOR', 'ADMIN', 'USER'])
We have 17 tables in our DB and would like these and there relations to be pulled into the schema file. Repro Steps 1. mkdir codu 2. cd codu 3. git clone https://github.com/codu-code/codu.git 4. Run
npm i
npm i
5. Look at the README to learn our to populate the .env file. The sample.env will give you the DB creds you need. Just rename it from sample.env -> .env 6. Run
docker compose up
docker compose up
7. Run
npx prisma db push
npx prisma db push
8. Add
out: "./drizzle"
out: "./drizzle"
to drizzle.config,ts file 9. Run
npx drizzle-kit introspect:pg
npx drizzle-kit introspect:pg
Any help greatly appreciated
3 replies
ATApache TinkerPop
Created by JohnAllen on 8/25/2023 in #questions
adding edges to multiple vertices at once
Hey all. Working with tinkerpop on Cosmos Gremlin DB which is horrific. Wondering is there anyway around adding an edge from multiple vertices at the same time? For example g.V(vertexId).addE(“linked_to”).from(__.V(vertex2,vertex3)) Thanks for any help. This has stumped me for three days 😂
7 replies