gwilliamnn
gwilliamnn
Explore posts from servers
DTDrizzle Team
Created by gwilliamnn on 12/13/2024 in #help
New version Not use IF NOT EXIST'S anymore
No description
2 replies
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
CCConvex Community
Created by gwilliamnn on 8/10/2023 in #support-community
indexSearch with "match"
Hello, I'm trying to make a simple search index, but the db will be large, because is customers db, and we have more than 10.000. I wanna search the user by a name query, example, when user search mari this will match with (maria, mariah, mariana) on documentation, i'm trying to do with the tasks table, and the only match with the exacly word.
8 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
CCConvex Community
Created by gwilliamnn on 8/7/2023 in #support-community
Seed data with relations
Hy, I know has a way to seed with json file, but how can I do to seed using relation data? Is possible just with json or I need create a function to seed using the api? Thanks (sorry for too many questions)
15 replies
CCConvex Community
Created by gwilliamnn on 8/7/2023 in #support-community
Bug after change function
I made a change on my schema, the table before called profile now is called profiles, I change all names on my code, is reflecting on the backend panel at the convex dashboard, but I'm getting this error:
- error Error: Could not find public function for 'profile:update'. Did you forget to run `npx convex dev` or `npx convex deploy`?

at ConvexHttpClient.mutation (webpack-internal:///(rsc)/./node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/convex/dist/esm/browser/http_client.js:126:23)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async handleClerkWebhook (webpack-internal:///(rsc)/./src/app/(api)/api/webhook/auth/utils.ts:35:17)
at async eval (webpack-internal:///(rsc)/./node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/future/route-modules/app-route/module.js:253:37)
- error Error: Could not find public function for 'profile:update'. Did you forget to run `npx convex dev` or `npx convex deploy`?

at ConvexHttpClient.mutation (webpack-internal:///(rsc)/./node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/convex/dist/esm/browser/http_client.js:126:23)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async handleClerkWebhook (webpack-internal:///(rsc)/./src/app/(api)/api/webhook/auth/utils.ts:35:17)
at async eval (webpack-internal:///(rsc)/./node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/future/route-modules/app-route/module.js:253:37)
And I call this function here:
if (body.type === "user.updated") {
const name =
(body.data.first_name ? body.data.first_name : "No") +
" " +
(body.data.last_name ? body.data.last_name : "Name")

console.log(name)

await client.mutation(api.profiles.update, {
userId: body.data.id,
name,
email: body.data.email_addresses[0].email_address,
avatarUrl: body.data.profile_image_url,
})

console.log("Profile updated")
}
if (body.type === "user.updated") {
const name =
(body.data.first_name ? body.data.first_name : "No") +
" " +
(body.data.last_name ? body.data.last_name : "Name")

console.log(name)

await client.mutation(api.profiles.update, {
userId: body.data.id,
name,
email: body.data.email_addresses[0].email_address,
avatarUrl: body.data.profile_image_url,
})

console.log("Profile updated")
}
21 replies
CCConvex Community
Created by gwilliamnn on 8/7/2023 in #support-community
Understanding the pricing
Hello! I'm really thinking to bring my production env from sanity.io to you guys. I love sanity, is very good, but the lack of strong type safety and the fact I loved convex, I wanna migrate. But, I didn't understand the princing... Like, function call is each query? and bandwidth will be the size of the query documents?
11 replies
CCConvex Community
Created by gwilliamnn on 8/7/2023 in #support-community
Suspense or loading state
Convex has any loading state or works with suspense or something like?
18 replies
CCConvex Community
Created by gwilliamnn on 7/31/2023 in #support-community
Can I import the Type from schemas?
How can I have the schema types, and if have also a validation schema like zod. This is good when we create forms and also tables to have the schema and or the return type.
10 replies
CCConvex Community
Created by gwilliamnn on 7/31/2023 in #support-community
How can I use Clerk with Convex on NextJS13 app routes?
Any one can help? I saw the tutorial to use Clerk + Convex on Next13, but is using pages router, I tried, but not works on app router, says router is not ready.
60 replies