AlexDaniel
DTDrizzle Team
•Created by AlexDaniel on 12/15/2024 in #help
Executing a query that was made with QueryBuilder
But that's the thing – the result from the QueryBuilder is already a query. I shouldn't really need to select from a subquery to use it. Ideally I should be able to just give the result of the querybuilder to the db object, but it seems like this is not possible :S
9 replies
DTDrizzle Team
•Created by AlexDaniel on 12/15/2024 in #help
Executing a query that was made with QueryBuilder
@Mario564 without .as it gives a long typescript error like:
ts: Argument of type 'Omit<PgSelectQueryBuilderBase<PgSelectQueryBuilderHKT, … … … is missing the following properties from type 'SQL<unknown>': queryChunks, shouldInlineParams, append, toQuery, and 5 more.
That's pretty much what made me ask this question – to me it's unclear what I can do with the query created from QueryBuilder. If I alias it, then I can do await db.select().from(queryFromQueryBuilder)
, but that is a bit strange/awkward.9 replies
DTDrizzle Team
•Created by AlexDaniel on 12/15/2024 in #help
Executing a query that was made with QueryBuilder
@Mario564 but I don't have the db object in that subproject, that's the point
9 replies
DTDrizzle Team
•Created by Jakesdoc on 10/8/2024 in #help
Transaction Type
basically, the trick is to use
typeof db.transaction
23 replies
DTDrizzle Team
•Created by Jakesdoc on 10/8/2024 in #help
Transaction Type
I use this:
It seems to work. I think I'm using drizzle-orm 0.38.0. But it's awkward.
23 replies
DTDrizzle Team
•Created by AlexDaniel on 12/15/2024 in #help
Executing a query that was made with QueryBuilder
One way to do it is:
This is somewhat awkward (e.g. the need to use
.as
). Is there any better way?9 replies
DTDrizzle Team
•Created by Fedox on 12/11/2024 in #help
_meta Directory purpose
if, however, you want to undo a migration just because you're iterating on the schema locally, then you should probably try
push
instead6 replies
DTDrizzle Team
•Created by Fedox on 12/11/2024 in #help
_meta Directory purpose
but, right now, to answer your questions:
* Yes, check it into the repository.
* If you want to undo a migration, you'd have to create a new reverse migration
6 replies
DTDrizzle Team
•Created by Fedox on 12/11/2024 in #help
_meta Directory purpose
supposedly the new migration system will add down migrations and there will be less conflicts between migrations from different PRs. Sounds exciting.
6 replies
DTDrizzle Team
•Created by Fedox on 12/11/2024 in #help
_meta Directory purpose
@Fedox Based on my understanding, this is something that is being worked on right now. It has been on the roadmap for drizzle v1 and it's one of the last remaining items. See https://github.com/drizzle-team/drizzle-orm/discussions/2832
6 replies
DTDrizzle Team
•Created by 𝓤𝓷𝓲𝓬 on 10/14/2024 in #help
Error with drizzle-kit push
@Firee sounds like it's unrelated to drizzle
14 replies
DTDrizzle Team
•Created by 𝓤𝓷𝓲𝓬 on 10/14/2024 in #help
Error with drizzle-kit push
my error did not look like yours though, @Sloperrrr, and it was more like the one in the OP
14 replies
DTDrizzle Team
•Created by 𝓤𝓷𝓲𝓬 on 10/14/2024 in #help
Error with drizzle-kit push
in my case I had package.json like this:
Then I did
pnpm install --dev
instead of pnpm install
and ended up with kit and no drizzle itself14 replies
DTDrizzle Team
•Created by 𝓤𝓷𝓲𝓬 on 10/14/2024 in #help
Error with drizzle-kit push
@Unic alright, actually, the issue was on my side. I was installing dev dependencies (with drizzle-kit) without installing drizzle itself (which was in regular dependencies). After installing everything, it is now working. So just install drizzle itself!
14 replies
DTDrizzle Team
•Created by 𝓤𝓷𝓲𝓬 on 10/14/2024 in #help
Error with drizzle-kit push
Same error. First time I see it 🤔
14 replies
DTDrizzle Team
•Created by html_extraordinaire on 10/5/2024 in #help
Lateral joins
I haven't found any workaround that'd allow it besides writing raw sql
6 replies
DTDrizzle Team
•Created by html_extraordinaire on 10/5/2024 in #help
Lateral joins
There's a PR for adding lateral joins from around one year ago: https://github.com/drizzle-team/drizzle-orm/pull/1079
I'm also waiting for it and I'm hopeful that it'll be merged for the next release
6 replies