Spoof
Spoof
Explore posts from servers
TTCTheo's Typesafe Cult
Created by Spoof on 1/15/2024 in #questions
callProcedure unavailable in TRPC v11
Hi there, TRPC released their v11 beta the other day and I am keen to upgrade (mostly for React Query bump to v5), however, they appear to have moved a load of stuff from @trpc/server into an internal package which is not supposed to be used externally. Of particular note is the callProcedure method used in T3's RSC/server-side link. This method would seem quite useful creating custom links in general, so I am unsure exactly why it has been "hidden". However, this leaves the app router version of the T3 stack a bit stuck! I appreciate it's early days, but I wonder if anyone has a reasonable workaround?
3 replies
DTDrizzle Team
Created by Spoof on 8/9/2023 in #help
customType causing type error when performing operation on table
I have a simple customType to use the citext extension in Postgres.
import { customType } from "drizzle-orm/pg-core";

export const citext = customType<{ data: string; driverData: string }>({
dataType() {
return "citext";
},
});
import { customType } from "drizzle-orm/pg-core";

export const citext = customType<{ data: string; driverData: string }>({
dataType() {
return "citext";
},
});
This is fine in my table:
export const access = pgTable("access", {
email: citext("email").primaryKey(),
});
export const access = pgTable("access", {
email: citext("email").primaryKey(),
});
But when I try to use the table (e.g. db.select().from(access)), I get the following error:
Argument of type 'PgTableWithColumns<{ name: "access"; schema: undefined; columns: { email: PgColumn<{ name: "email"; tableName: "access"; dataType: "custom"; columnType: "PgCustomColumn"; data: string; driverParam: string; notNull: true; hasDefault: false; enumValues: undefined; baseColumn: never; }, {}, {}>; }; dialect: "pg"; }>' is not assignable to parameter of type 'AnyPgTable<{}> | Subquery<string, unknown> | PgViewBase<string, boolean, ColumnsSelection> | SQL<unknown>'.

Type 'PgTable<{ name: "access"; schema: undefined; columns: { email: PgColumn<{ name: "email"; tableName: "access"; dataType: "custom"; columnType: "PgCustomColumn"; data: string; driverParam: string; notNull: true; hasDefault: false; enumValues: undefined; baseColumn: never; }, {}, {}>; }; dialect: "pg"; }> & { ...; }' is missing the following properties from type 'SQL<unknown>': queryChunks, shouldInlineParams, append, toQuery, and 5 more.
Argument of type 'PgTableWithColumns<{ name: "access"; schema: undefined; columns: { email: PgColumn<{ name: "email"; tableName: "access"; dataType: "custom"; columnType: "PgCustomColumn"; data: string; driverParam: string; notNull: true; hasDefault: false; enumValues: undefined; baseColumn: never; }, {}, {}>; }; dialect: "pg"; }>' is not assignable to parameter of type 'AnyPgTable<{}> | Subquery<string, unknown> | PgViewBase<string, boolean, ColumnsSelection> | SQL<unknown>'.

Type 'PgTable<{ name: "access"; schema: undefined; columns: { email: PgColumn<{ name: "email"; tableName: "access"; dataType: "custom"; columnType: "PgCustomColumn"; data: string; driverParam: string; notNull: true; hasDefault: false; enumValues: undefined; baseColumn: never; }, {}, {}>; }; dialect: "pg"; }> & { ...; }' is missing the following properties from type 'SQL<unknown>': queryChunks, shouldInlineParams, append, toQuery, and 5 more.
Custom type documentation is very limited. Has something changed here or am I doing something wrong?
1 replies