_tweak^prone
Explore posts from serversTTCTheo's Typesafe Cult
•Created by _tweak^prone on 7/30/2023 in #questions
Astro + DrizzleORM => trouble
Great - let me know if the usecase makes sense. But its super type-important 🙂
75 replies
TTCTheo's Typesafe Cult
•Created by _tweak^prone on 7/30/2023 in #questions
Astro + DrizzleORM => trouble
(and it will have to be an "any" type, or you have to make a 1:1 copy type of whatever you return from the drizzl db.table.select.leftjoin)
75 replies
TTCTheo's Typesafe Cult
•Created by _tweak^prone on 7/30/2023 in #questions
Astro + DrizzleORM => trouble
Problem is, if you take Drizzle results and parse it into a component, when you use it in the component the type will by definition be "lost", as theres no relation from the component to where you use the component.
75 replies
TTCTheo's Typesafe Cult
•Created by _tweak^prone on 7/30/2023 in #questions
Astro + DrizzleORM => trouble
The above example is a type containing SOME fields from "comment" type and SOME fields of "user" type - in a mixed type / result from the database.
In prisma you can do
commentGetPayload< your object that you pass into prisma db call without actually calling the database >
and that will return a type
that you can use to Type your parameters.75 replies
TTCTheo's Typesafe Cult
•Created by _tweak^prone on 7/30/2023 in #questions
Astro + DrizzleORM => trouble
75 replies
TTCTheo's Typesafe Cult
•Created by _tweak^prone on 7/30/2023 in #questions
Astro + DrizzleORM => trouble
yearh, but sadly that doesnt solve the problem :/ it deosnt take relations into account
75 replies
TTCTheo's Typesafe Cult
•Created by _tweak^prone on 7/30/2023 in #questions
Astro + DrizzleORM => trouble
its just - to me drizzlekit seems more like prisma studio and push/pull - not type-generation
75 replies
TTCTheo's Typesafe Cult
•Created by _tweak^prone on 7/30/2023 in #questions
Astro + DrizzleORM => trouble
So for example, lets say i have this Drizzl:
This gets the comments and merges in the "user" type with a leftjoin
I make a component:
<ShowComment comment={...}>
And i want the TYPE of the prop "comment" in my component props to be exactly one of the returntypes of the above drizzl.
So i go like this:
Can Drizzlekit give me "????" ?75 replies
TTCTheo's Typesafe Cult
•Created by _tweak^prone on 7/30/2023 in #questions
Astro + DrizzleORM => trouble
this means i can use ´PostComponentMainType` as my "requred type" in a function props for example
75 replies
TTCTheo's Typesafe Cult
•Created by _tweak^prone on 7/30/2023 in #questions
Astro + DrizzleORM => trouble
What i meant was this:
Prisma has this:
Its the Typescript-type-definition of the Payload call you are about to make
75 replies
TTCTheo's Typesafe Cult
•Created by _tweak^prone on 7/30/2023 in #questions
Astro + DrizzleORM => trouble
im not sure i understand - this is more of a Prisma Studio thing right?
75 replies
TTCTheo's Typesafe Cult
•Created by _tweak^prone on 7/30/2023 in #questions
Astro + DrizzleORM => trouble
Like prisma has
75 replies
TTCTheo's Typesafe Cult
•Created by _tweak^prone on 7/30/2023 in #questions
Astro + DrizzleORM => trouble
do you know if theres anyway to get the Type-definition returned by a Drizzl-call ? So that it can be used as a parameter for a function (for example)
75 replies
TTCTheo's Typesafe Cult
•Created by _tweak^prone on 7/30/2023 in #questions
Astro + DrizzleORM => trouble
yearh, but i enjou the joins. the control 🙂
75 replies
TTCTheo's Typesafe Cult
•Created by _tweak^prone on 7/30/2023 in #questions
Astro + DrizzleORM => trouble
Very nice ! I like drizzl as its much closer to Laravels Eloquent.
75 replies
TTCTheo's Typesafe Cult
•Created by _tweak^prone on 7/30/2023 in #questions
Astro + DrizzleORM => trouble
Thanks a bunch m8 ! Hope this hold ! And what a bizarre thing 1
75 replies
TTCTheo's Typesafe Cult
•Created by _tweak^prone on 7/30/2023 in #questions
Astro + DrizzleORM => trouble
at the moment yes, but i will have to see it over the course of hours now
75 replies
TTCTheo's Typesafe Cult
•Created by _tweak^prone on 7/30/2023 in #questions
Astro + DrizzleORM => trouble
I will have to test this quite a bit more but it seems specifiying the same content in an object, instead of in a connection string.. fixed it 😮
75 replies
TTCTheo's Typesafe Cult
•Created by _tweak^prone on 7/30/2023 in #questions
Astro + DrizzleORM => trouble
The shot in the dark seemed to work. Let me try with connectionString instead
75 replies
TTCTheo's Typesafe Cult
•Created by _tweak^prone on 7/30/2023 in #questions
Astro + DrizzleORM => trouble
I can try with specifying host/user/db instead of connectionstring. 2 secs
75 replies