jakeleventhal
Explore posts from serversDTDrizzle Team
•Created by jakeleventhal on 10/8/2024 in #help
0.32.0 introduces unmentioned breaking change
2 replies
DTDrizzle Team
•Created by jakeleventhal on 5/30/2024 in #help
Best way to get all unique strings from string[] column
I have a column
listings.tags
which is a postgres string array. I want a query to find all unique strings that match a query. Is there a better or even more drizzle-y way to do this vs. my current code:
1 replies
DTDrizzle Team
•Created by jakeleventhal on 5/10/2024 in #help
Best way to get count in extras
is there a better way to do this without the
sql
operator? I want to just use drizzle code (to make more complex queries). if i try to, i get weird issues. similarly, if i replace "Product"."productSetId"
with ${products.productSetId}
, it tells me productSetId
does not exist on the ProductSet table (it uses the wrong table)2 replies
DTDrizzle Team
•Created by jakeleventhal on 3/26/2024 in #help
How to check for non-backwards compatible schema changes
I want to create a check in my CI pipeline to see if there is a schema change that is not backwards compatible. How can I do this?
I see there is a command for
drizzle-kit check:{dialect}
, but that doesn't really solve my use case.
Basically what I want to know is whether or not the schema change I have will work without truncation of tables.1 replies
DTDrizzle Team
•Created by jakeleventhal on 3/21/2024 in #help
What is the best way to order by exact matches
1 replies
DTDrizzle Team
•Created by jakeleventhal on 3/19/2024 in #help
How do you use batch API with local development
If you use Neon, but do local development using postgres-js in docker, how can you write code that uses batch API? it seems like there should be some sort of shim that runs batches as a transaction under the hood to allow the same drizzle code to run for drivers that don't support batches.
3 replies
DTDrizzle Team
•Created by jakeleventhal on 3/19/2024 in #help
Parallel transactions not working with AWS data API
https://github.com/aws/aws-sdk-js/issues/4615
Has anyone figured out a way around this issue?
1 replies
DTDrizzle Team
•Created by jakeleventhal on 1/24/2024 in #help
How do you compare counts in a query?
how would you do this in drizzle without just using the sql operator
1 replies
DTDrizzle Team
•Created by jakeleventhal on 1/22/2024 in #help
Getting seemingly incorrect relation error
Shouldnt this be sufficient for relation names? If not, i dont see how i could even add one? my schema was working with prisma so i dont think i need to add another FK
11 replies
DTDrizzle Team
•Created by jakeleventhal on 1/20/2024 in #help
Anyone have any idea about this bug?
14 replies
DTDrizzle Team
•Created by jakeleventhal on 1/18/2024 in #help
Many to many relation not enough information
when i query
it tells me
Error: There is not enough information to infer relation "orders.stripeTransactions"what other info could be needed
44 replies
DTDrizzle Team
•Created by jakeleventhal on 1/18/2024 in #help
How do you define one-to-one relations in the same table?
How would you define a
relationName
here if there is no field for the id of the digitalListing (this schema was working in prisma world)
basically i have a table of listings, and one can be linked to another
the problem is that if i want to define a relationName in the config for digitalListing, it expects fields and references21 replies
DTDrizzle Team
•Created by jakeleventhal on 1/17/2024 in #help
How are you supposed to get triple-nested where queries to work?
3 replies
DTDrizzle Team
•Created by jakeleventhal on 1/16/2024 in #help
Is there a smarter way to use optional query values
is there a cleaner way to not have to do things this way?
6 replies
DTDrizzle Team
•Created by jakeleventhal on 1/12/2024 in #help
Is this a bug with arrays?
In postgres I have a column defined like this:
For insertions, drizzle says I don't need to define
someArrayField
since it has a default. Yet when I try to insert a record, I get this error:
Am I doing this incorrectly? interestingly, on localhost, this has no issues when I use import { drizzle } from 'drizzle-orm/postgres-js';
This only has issues when deployed when I use import { drizzle } from 'drizzle-orm/neon-serverless';
I wanted to just do .default([])
but then drizzle kit tells me:
23 replies
DTDrizzle Team
•Created by jakeleventhal on 1/11/2024 in #help
How to use sql template strings
this should be resolving to valid sql
55 replies
DTDrizzle Team
•Created by jakeleventhal on 1/11/2024 in #help
Smarter way to update while creating
In prisma, I can do something like this:
is there a smarter way to do this in drizzle? currently im doing this:
this is extremely slow to do the promise.all here. it would be much more efficient to just do this upon creation of the
blogs
if i could just do a create many and name one trip to the db. at the very least i'd like to be able to do 2 trips (one for the creation of all the new blogs and one for the user updates)9 replies
DTDrizzle Team
•Created by jakeleventhal on 1/10/2024 in #help
Guarantee on returning order
Is there a guarantee that
await db.insert(sometable).values(someArray).returning()
will always return in the same order as someArray4 replies
DTDrizzle Team
•Created by jakeleventhal on 1/10/2024 in #help
Subquery/join in relational query
are the following queries identical?
3 replies
DTDrizzle Team
•Created by jakeleventhal on 1/8/2024 in #help
How to run drizzle-kit studio out of docker?
I'm trying to run
drizzle-kit studio
out of docker:
When I run docker-compose, I get the following log:
ecominate-drizzle-studio-1 | Drizzle Studio is up and running on https://local.drizzle.studioyet when i visit the browser, it says its "Connecting to the Drizzle Kit on localhost:4983" are there separate docker instructions for how to run this?
13 replies