hotshoe
Explore posts from serversDTDrizzle Team
•Created by NotLuksus on 8/2/2023 in #help
ReferenceError: Cannot access 'addon' before initialization
Hi @Angelelz , got to the bottom of the issue with your help. When I created my relations to support query (after creating my table schemas), I didn't go back and add
relations.schema.ts
to the list of barrel exports. (Like I mentioned, I originally had them factored out this way.) This in-turn lead me to incorrectly believe I needed to keep the relations in same file as user.schema
, which admittedly made no sense to me, but it worked -- from perspective of being able to type out the query in VS -- in effect sending me down the wrong path.
Apologies for eating up your time on this, and I much appreciate! Hopefully helps somebody down the road who runs into similar.
Thanks again!! You rock.32 replies
DTDrizzle Team
•Created by NotLuksus on 8/2/2023 in #help
ReferenceError: Cannot access 'addon' before initialization
I'll take a look now. ty for this!
32 replies
DTDrizzle Team
•Created by NotLuksus on 8/2/2023 in #help
ReferenceError: Cannot access 'addon' before initialization
Btw, ty for taking time to look into this. I'll go ahead and give another try breaking out the relations into separate file(s), but wasn't working for me last night.
32 replies
DTDrizzle Team
•Created by NotLuksus on 8/2/2023 in #help
ReferenceError: Cannot access 'addon' before initialization
i'll try again, but is there any special convention I need to follow? Or idea is I should be able to express relations in sidecar files along side my schema (just like what you have ^^).
32 replies
DTDrizzle Team
•Created by NotLuksus on 8/2/2023 in #help
ReferenceError: Cannot access 'addon' before initialization
I tried that, but then the relations don't seem to get picked up when I build query
32 replies
DTDrizzle Team
•Created by NotLuksus on 8/2/2023 in #help
ReferenceError: Cannot access 'addon' before initialization
I'm all ears
32 replies
DTDrizzle Team
•Created by NotLuksus on 8/2/2023 in #help
ReferenceError: Cannot access 'addon' before initialization
Thank you @Angelelz . Btw, the repro does indeed have circ deps, but these are artifacts of expressing relations between schema in multiple files. Very possible I'm going about it the wrong way, but not seeing any other way short of expressing expressing all in a single file (my current workaround).
32 replies
DTDrizzle Team
•Created by NotLuksus on 8/2/2023 in #help
ReferenceError: Cannot access 'addon' before initialization
Here is a repo repro'ing the issue -- https://github.com/rolanday/drizzle-circ-dep
It's a solid-start project, but not important. Just run the package.json
db:push
script and you'll see output below. I didn't bother working up a query because I've observed that whenever the push command fails so will the runtime query.
32 replies
DTDrizzle Team
•Created by NotLuksus on 8/2/2023 in #help
ReferenceError: Cannot access 'addon' before initialization
I'll work on a repro. I previously (before filing ticket) double and triple checked for an circ deps on my end and the only ones I could find were the ones that the drizzle schema and relatiions declarations require me to introduce.
32 replies
DTDrizzle Team
•Created by NotLuksus on 8/2/2023 in #help
ReferenceError: Cannot access 'addon' before initialization
Again, for anybody running into this issue, adding all my schema and relations into single file resolved the issue for me.
32 replies
DTDrizzle Team
•Created by NotLuksus on 8/2/2023 in #help
ReferenceError: Cannot access 'addon' before initialization
Filed issue here ... https://github.com/drizzle-team/drizzle-orm/issues/1308
32 replies
DTDrizzle Team
•Created by NotLuksus on 8/2/2023 in #help
ReferenceError: Cannot access 'addon' before initialization
Same issue here. Can somebody from drizzle team please comment? Appears to be a circular reference problem that breaks queries and drizzle-kit push, etc. I'm working around the issue by putting all my schema into the same file, but this is less than ideal, naturally. I'd create a repro but I've already lost my entire evening to this (but will do so if needed. just lmk). thx!
32 replies
DTDrizzle Team
•Created by hotshoe on 4/20/2023 in #help
many-to-one selection as array
Thanks for pointing this out -- I was hoping to not send redundant data over the wire (like same city info for each row in this example) but this def looks like a workable solution -- avoids multiple round trips to SQL end. Thank you! My sql is aweful (one of motivations for me switching to drizzle so to take step towards fixing that and not be reliant on fully abstracted ORM like w/ prisma), so perhaps I'm naively thinking this is something SQL should handle in general since pretty basic scenario. Again, thank you 🙂
7 replies
DTDrizzle Team
•Created by hotshoe on 4/20/2023 in #help
many-to-one selection as array
Thanks @rphlmr , I failed to mention I'm on mysql (planetscale) but this is something sql should handle, but ORMs (like Prisma) have given this to me for free -- so I'm struggling to get to work. groupBy does not work for me -- late where I am but will post more concrete example if still no luck tomorrow w/ fresh eyes -- in mean time, if anybody has other suggestion please advise -- I wasted my whole eventing trying to get query semantics right on this 😦
7 replies
DTDrizzle Team
•Created by hotshoe on 4/11/2023 in #help
many-to-one transaction
Thanks @Luxaritas , much appreciate the suggestion and pointer. Will take a closer look.
6 replies
DTDrizzle Team
•Created by hotshoe on 4/11/2023 in #help
many-to-one transaction
Never mind on first part -- found I can simply pass array into values for matching type. Too easy :0) Still curious about if a way I can include non-db calls into transaction.
6 replies
DTDrizzle Team
•Created by hotshoe on 4/4/2023 in #help
compound uniqueIndex
Thanks for the quick response!
4 replies
DTDrizzle Team
•Created by hotshoe on 4/4/2023 in #help
planetscale: how to index col using drizzle?
Thanks Raphaël! That did the trick. Much appreciated 🙂
5 replies