hotshoe
hotshoe
Explore posts from servers
SSolidJS
Created by hotshoe on 12/20/2023 in #support
Beta2: How do I render html attribute server-side
@gh680 , yes, saw that too. question is how to [dynamically] render attributes into root (html) element. SvelteKit provides transformPageChunk to handle this, and Remix give access full tree in root so it's a no-brainer.
4 replies
DTDrizzle 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.
Reading config file '/Users/roland/GitHub/public/issues/drizzle-circ-dep/drizzle.config.ts'
ReferenceError: Cannot access 'account' before initialization
at Object.account (/Users/roland/GitHub/public/issues/drizzle-circ-dep/src/schema/account.schema.ts:1:1)
at Object.get [as account] (/Users/roland/GitHub/public/issues/drizzle-circ-dep/src/schema/account.schema.ts:14:45)
at Object.<anonymous> (/Users/roland/GitHub/public/issues/drizzle-circ-dep/src/schema/user.schema.ts:17:43)
at Module._compile (node:internal/modules/cjs/loader:1256:14)
at Module._compile (/Users/roland/GitHub/public/issues/drizzle-circ-dep/node_modules/drizzle-kit/index.cjs:8623:30)
at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
at Object.newLoader [as .ts] (/Users/roland/GitHub/public/issues/drizzle-circ-dep/node_modules/drizzle-kit/index.cjs:8627:13)
at Module.load (node:internal/modules/cjs/loader:1119:32)
at Module._load (node:internal/modules/cjs/loader:960:12)
at Module.require (node:internal/modules/cjs/loader:1143:19)
Reading config file '/Users/roland/GitHub/public/issues/drizzle-circ-dep/drizzle.config.ts'
ReferenceError: Cannot access 'account' before initialization
at Object.account (/Users/roland/GitHub/public/issues/drizzle-circ-dep/src/schema/account.schema.ts:1:1)
at Object.get [as account] (/Users/roland/GitHub/public/issues/drizzle-circ-dep/src/schema/account.schema.ts:14:45)
at Object.<anonymous> (/Users/roland/GitHub/public/issues/drizzle-circ-dep/src/schema/user.schema.ts:17:43)
at Module._compile (node:internal/modules/cjs/loader:1256:14)
at Module._compile (/Users/roland/GitHub/public/issues/drizzle-circ-dep/node_modules/drizzle-kit/index.cjs:8623:30)
at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
at Object.newLoader [as .ts] (/Users/roland/GitHub/public/issues/drizzle-circ-dep/node_modules/drizzle-kit/index.cjs:8627:13)
at Module.load (node:internal/modules/cjs/loader:1119:32)
at Module._load (node:internal/modules/cjs/loader:960:12)
at Module.require (node:internal/modules/cjs/loader:1143:19)
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
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
SSolidJS
Created by hotshoe on 9/23/2023 in #support
root.tsx & cookies
Did a little more reading and this seems to work, but, again, please lmk if a better or prescribed method for accomplishing the same, as this is very common use case. Thanks!
// root.data.ts
import {
createServerData$,
useRequest,
useServerContext,
} from "solid-start/server";
import { isServer } from "solid-js/web";

export default () => {
const event = useRequest();
if (isServer) {
const cookie = event.request.headers.get("cookie");
// parse it
// return parsed cookie val;
}
};
// root.data.ts
import {
createServerData$,
useRequest,
useServerContext,
} from "solid-start/server";
import { isServer } from "solid-js/web";

export default () => {
const event = useRequest();
if (isServer) {
const cookie = event.request.headers.get("cookie");
// parse it
// return parsed cookie val;
}
};
// root.tsx
const data = useRouteData<T>();

// use it wherever
// root.tsx
const data = useRouteData<T>();

// use it wherever
`
2 replies
DTDrizzle Team
Created by hotshoe on 4/24/2023 in #help
onUpdateNow usage
Thx Dan.
3 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