ptrxyz
ptrxyz
Explore posts from servers
PPrisma
Created by ptrxyz on 9/24/2024 in #help-and-questions
concat two Prisma.sql queries.
I have two pretty complex queries which i created manually using
const a = Prisma.sql(...)
const b = Prisma.sql(...)
const a = Prisma.sql(...)
const b = Prisma.sql(...)
In some cases and since both return the same data type, I would like to run them in one go concatenated using (QUERY1) UNION (QUERY2). So, my question is: How can I concat two Prisma.sql queries?
8 replies
PPrisma
Created by ptrxyz on 3/17/2024 in #help-and-questions
Multiple Prisma clients and connection pooling
I would like to use multiple Prisma clients in my application, basically like so:
const p1 = new PrismaClient({config})
const p2 = new PrismaClient({config})
const p1 = new PrismaClient({config})
const p2 = new PrismaClient({config})
I wonder if they share the same connection pool and when they connect to the database. Does Prisma connect on first query or as soon as you create the client? And in my example, do p1 and p2 connect separately and keep different connection pools or do they share the same underlying pool since they both use the same configuration?
2 replies
DTDrizzle Team
Created by ptrxyz on 9/17/2023 in #help
TIMESTAMPTZ is returned as string instead of Date object
No description
9 replies
DTDrizzle Team
Created by ptrxyz on 9/15/2023 in #help
Migrating from Prisma Schema
I want to migrate away from Prisma, but I can't seem to find a good way to get the schema right: - Drizzle's introspect feature somehow generates garbage with VARCHARs deafult values, I saw that this seems to be a known issue on GitHub, so I suppose there is nothign I can do about that? - Then, while 1:1 relations seem to be covered, I can't get it to generate any (many:many) relations. How is that done by Drizzle? Does it use some kind of heuristics to detect relations? Our company's model has roughly 100 tables and for now we used Prisma to handle it, so we have a prisma schema in case that helps anything, but managing all relations manually is probably error prone and a bit of a problem. - Kysely has a nice generator to generate types from a Prisma schema. Can Drizzle also do that?
5 replies
DDeno
Created by ptrxyz on 8/28/2023 in #help
Getting free disk space without using child_process.
Hello everyone! I would like to create a small CLI tool using Typescript and Deno. I would like to monitor the free disk space on several disks. How can I get the free disk space on a Linux machine without forking a separate process (like exec --> df and the like)? In addition, I would like to deno compile my little program later, so I am not sure if Node's gyp is an option then.
9 replies