gwilliamnn
gwilliamnn
Explore posts from servers
DTDrizzle Team
Created by gwilliamnn on 11/11/2024 in #help
With Query mode, is possible filter by a related table?
Is possible using db.query to filter (where) using a related table? Example:
const users = await db.query.posts.findMany({
where: (users, { eq }) => eq(posts.user.id, 1), // related user with post
})
const users = await db.query.posts.findMany({
where: (users, { eq }) => eq(posts.user.id, 1), // related user with post
})
I know we can use with, but with will return the result and we can filter the with, I wanna filter the actual query using the related table. We can do using the select
await db.select().from(posts).rightJoin(users, eq(users.id, posts.userId)).where(eq(posts.userId, users.id)
await db.select().from(posts).rightJoin(users, eq(users.id, posts.userId)).where(eq(posts.userId, users.id)
3 replies
DTDrizzle Team
Created by gwilliamnn on 8/16/2024 in #help
Create a schema but hide from push, migrate and generate
I'm using with Supabase, and I would like to add some schemas from supabase, but I don't wanna include this at push, generate and migrate. I know the filter tables and schema work for push, but I think do not work for all this.
1 replies
TtRPC
Created by gwilliamnn on 7/30/2024 in #❓-help
tRPC with Next Intl
I'm getting errors when use Next Intl with Trpc App Router When I call the route, the middleware from next intl change the route to set the locale first [en-es] and the 404 in the route. https://next-intl-docs.vercel.app/docs/routing/middleware Some one can help?
2 replies
TtRPC
Created by gwilliamnn on 10/24/2023 in #❓-help
I wanna add a localStorage persister, but I'm getting errors for hydration:
I wanna add a localStorage persister, but I'm getting errors for hydration:
const persister = createSyncStoragePersister({
storage: window.localStorage,
throttleTime: 1000,
retry: removeOldestQuery,
serialize: data => JSON.stringify(data),
deserialize: data => JSON.parse(data) as PersistedClient
})

...
return (
<PersistQueryClientProvider
client={queryClient}
persistOptions={{ persister }}
>
<apiClient.Provider client={trpcClient} queryClient={queryClient}>
{props.children}
...
const persister = createSyncStoragePersister({
storage: window.localStorage,
throttleTime: 1000,
retry: removeOldestQuery,
serialize: data => JSON.stringify(data),
deserialize: data => JSON.parse(data) as PersistedClient
})

...
return (
<PersistQueryClientProvider
client={queryClient}
persistOptions={{ persister }}
>
<apiClient.Provider client={trpcClient} queryClient={queryClient}>
{props.children}
...
ERROR:
const persister = createSyncStoragePersister({
> 59 | storage: window.localStorage,
| ^
60 | throttleTime: 1000,
61 | retry: removeOldestQuery,
62 | serialize: data => JSON.stringify(data),
const persister = createSyncStoragePersister({
> 59 | storage: window.localStorage,
| ^
60 | throttleTime: 1000,
61 | retry: removeOldestQuery,
62 | serialize: data => JSON.stringify(data),
3 replies
TTCTheo's Typesafe Cult
Created by gwilliamnn on 10/24/2023 in #questions
How can I use a localStorage persister?
I wanna add a localStorage persister, but I'm getting errors for hydration:
const persister = createSyncStoragePersister({
storage: window.localStorage,
throttleTime: 1000,
retry: removeOldestQuery,
serialize: data => JSON.stringify(data),
deserialize: data => JSON.parse(data) as PersistedClient
})

...
return (
<PersistQueryClientProvider
client={queryClient}
persistOptions={{ persister }}
>
<apiClient.Provider client={trpcClient} queryClient={queryClient}>
{props.children}
...
const persister = createSyncStoragePersister({
storage: window.localStorage,
throttleTime: 1000,
retry: removeOldestQuery,
serialize: data => JSON.stringify(data),
deserialize: data => JSON.parse(data) as PersistedClient
})

...
return (
<PersistQueryClientProvider
client={queryClient}
persistOptions={{ persister }}
>
<apiClient.Provider client={trpcClient} queryClient={queryClient}>
{props.children}
...
ERROR:
const persister = createSyncStoragePersister({
> 59 | storage: window.localStorage,
| ^
60 | throttleTime: 1000,
61 | retry: removeOldestQuery,
62 | serialize: data => JSON.stringify(data),
const persister = createSyncStoragePersister({
> 59 | storage: window.localStorage,
| ^
60 | throttleTime: 1000,
61 | retry: removeOldestQuery,
62 | serialize: data => JSON.stringify(data),
9 replies
TTCTheo's Typesafe Cult
Created by gwilliamnn on 10/17/2023 in #questions
New App Router is not working!
The new t3 for App Router is not working, I just installed and pnpm dev and not works!
10 replies
TtRPC
Created by gwilliamnn on 8/9/2023 in #❓-help
How can I enable experimental Suspense on NextJS
O have a project with trpc (v.10^) and nextjs 13, and I wanna test the suspense query, but not show for me, just the normal useQuery.
2 replies