Tim (from typesafe.courses)
Tim (from typesafe.courses)
Explore posts from servers
DTDrizzle Team
Created by Tim (from typesafe.courses) on 11/16/2023 in #help
how to use ilike securely?
ilike(table, sql%${userQuery}%) produces the wrong SQL code by adding quotes around the userQuery text. however we can't use sql.raw as it would make this suceptible to sql injection. how can we interpolate user provided for ilike ? Thx
5 replies
TtRPC
Created by Tim (from typesafe.courses) on 4/25/2023 in #❓-help
Expression produces a union type that is too complex to represent
Hi! I have started to encounter the above on error on pretty simple react components using trpc v10 useQuery hooks + zod for validation. Pretty standard type inference all the way. Arbitrary blocks of jsx are marked with that error. I am looking for pointers on how to debug this. Any help is appreciated! Tim.
3 replies
TtRPC
Created by Tim (from typesafe.courses) on 2/8/2023 in #❓-help
Distribute typesafe tRPC Client in an NPM library
Hi ! super fan of trpc over here. We are building a javascript sdk for our API that is essentially a pacakged version of the trpc client. However when compiling the code, the "materialized" type is a generic client/router and not the inferred typesafe version. e.g
opts: _trpc_react.CreateTRPCClientOptions<_trpc_server_dist_declarations_src_router.Router<AppContextCore, unknown, any, any, any, any, _trpc_server.DefaultErrorShape>>) => _trpc_react.TRPCClient<_trpc_server_dist_declarations_src_router.Router<AppContextCore, unknown, any, any, any, any, _trpc_server.DefaultErrorShape>>;
opts: _trpc_react.CreateTRPCClientOptions<_trpc_server_dist_declarations_src_router.Router<AppContextCore, unknown, any, any, any, any, _trpc_server.DefaultErrorShape>>) => _trpc_react.TRPCClient<_trpc_server_dist_declarations_src_router.Router<AppContextCore, unknown, any, any, any, any, _trpc_server.DefaultErrorShape>>;
Any thoughts ? tRPC seems like a perfect fit for this use case. Thanks!
1 replies