acronie
acronie
Explore posts from servers
DTDrizzle Team
Created by acronie on 11/16/2024 in #help
`TypeError: Cannot read properties of undefined (reading 'query')`
import "dotenv/config";
import * as schema from "./schema.js";
import { drizzle } from "drizzle-orm/node-postgres";

const db = drizzle(process.env.DATABASE_URL!, {
schema,
});

export { db };
import "dotenv/config";
import * as schema from "./schema.js";
import { drizzle } from "drizzle-orm/node-postgres";

const db = drizzle(process.env.DATABASE_URL!, {
schema,
});

export { db };
```
25 replies
NNovu
Created by acronie on 1/30/2024 in #πŸ’¬β”‚support
Help regarding workflows
hey, so I was going through workkflows and don't really get the idea behind it? Is it supposed to be indiviual workflows for each?
52 replies
DTDrizzle Team
Created by acronie on 12/19/2023 in #help
Type error when passing schema to drizzle
export const db: PostgresJsDatabase = drizzle(queryClient, {
schema: schema,
logger: true,
})
export const db: PostgresJsDatabase = drizzle(queryClient, {
schema: schema,
logger: true,
})
I am passing my schema like this
β”‚ ξͺ‡ Type 'PostgresJsDatabase<typeof import("/Users/mooy/Desktop/projects/tracker/apps/api/src/db/schema/schema")>' is not assignable to type 'PostgresJsDatabase'. typescript (2322) [7, 14]
β”‚ The types of '_.schema' are incompatible between these types.
β”‚ Type 'ExtractTablesWithRelations<typeof import("/Users/mooy/Desktop/projects/tracker/apps/api/src/db/schema/schema")> | undefined' is not assignable to type 'ExtractTablesWithRelations<Record<string, never>> | undefined'.
β”‚ Type 'ExtractTablesWithRelations<typeof import("/Users/mooy/Desktop/projects/tracker/apps/api/src/db/schema/schema")>' is not assignable to type 'ExtractTablesWithRelations<Record<string, never>>'.
β”‚ Property 'key' is incompatible with index signature.
β”‚ Type '{ tsName: "key"; dbName: "user_key"; columns: { id: PgColumn<{ name: "id"; tableName: "user_key"; dataType: "string"; columnType: "PgVarchar"; data: string; driverParam: string; notNull: true; hasDefault: false; enumValues: [...]; baseColumn: never; }, {}, {}>; userId: PgColumn<...>; hashedPassword: PgColumn<...>; }...' is not assignable to type '{ tsName: string; dbName: never; columns: never; relations: Record<string, Relation<string>>; primaryKey: AnyColumn[]; }'.
β”‚ Types of property 'dbName' are incompatible.
β”‚ Type 'string' is not assignable to type 'never'.
β”‚ ξͺ‡ Type 'PostgresJsDatabase<typeof import("/Users/mooy/Desktop/projects/tracker/apps/api/src/db/schema/schema")>' is not assignable to type 'PostgresJsDatabase'. typescript (2322) [7, 14]
β”‚ The types of '_.schema' are incompatible between these types.
β”‚ Type 'ExtractTablesWithRelations<typeof import("/Users/mooy/Desktop/projects/tracker/apps/api/src/db/schema/schema")> | undefined' is not assignable to type 'ExtractTablesWithRelations<Record<string, never>> | undefined'.
β”‚ Type 'ExtractTablesWithRelations<typeof import("/Users/mooy/Desktop/projects/tracker/apps/api/src/db/schema/schema")>' is not assignable to type 'ExtractTablesWithRelations<Record<string, never>>'.
β”‚ Property 'key' is incompatible with index signature.
β”‚ Type '{ tsName: "key"; dbName: "user_key"; columns: { id: PgColumn<{ name: "id"; tableName: "user_key"; dataType: "string"; columnType: "PgVarchar"; data: string; driverParam: string; notNull: true; hasDefault: false; enumValues: [...]; baseColumn: never; }, {}, {}>; userId: PgColumn<...>; hashedPassword: PgColumn<...>; }...' is not assignable to type '{ tsName: string; dbName: never; columns: never; relations: Record<string, Relation<string>>; primaryKey: AnyColumn[]; }'.
β”‚ Types of property 'dbName' are incompatible.
β”‚ Type 'string' is not assignable to type 'never'.
but it returns this error
4 replies
TtRPC
Created by acronie on 11/26/2023 in #❓-help
WS with TRPC
β”‚ ξͺ‡ Type '({ req, res, }: { req: Request; res: Response; }) => CreateInnerContextOpts' is not assignable to type 'NodeHTTPCreateContextFn<CreateRouterInner<RootConfig<{ ctx: CreateInnerContextOpts; meta: object; errorShape: { data: { zodError: typeToFlattenedError<any, string> | null; code: "PARSE_ERROR" | ... 13 more ... | "CLIENT_CLOSED_REQUEST"; httpStatus: number; path?: string | undefined; stack?: string | undefined; }; me...'. typescript (2322) [12, 3]
β”‚ Types of parameters '__0' and 'opts' are incompatible.
β”‚ Type 'NodeHTTPCreateContextFnOptions<IncomingMessage, WebSocket>' is not assignable to type '{ req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>; res: Response<any, Record<string, any>>; }'.
β”‚ Types of property 'req' are incompatible.
β”‚ Type 'IncomingMessage' is missing the following properties from type 'Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>': get, header, accepts, acceptsCharsets, and 26 more.
β”‚ ξͺ‡ Type '({ req, res, }: { req: Request; res: Response; }) => CreateInnerContextOpts' is not assignable to type 'NodeHTTPCreateContextFn<CreateRouterInner<RootConfig<{ ctx: CreateInnerContextOpts; meta: object; errorShape: { data: { zodError: typeToFlattenedError<any, string> | null; code: "PARSE_ERROR" | ... 13 more ... | "CLIENT_CLOSED_REQUEST"; httpStatus: number; path?: string | undefined; stack?: string | undefined; }; me...'. typescript (2322) [12, 3]
β”‚ Types of parameters '__0' and 'opts' are incompatible.
β”‚ Type 'NodeHTTPCreateContextFnOptions<IncomingMessage, WebSocket>' is not assignable to type '{ req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>; res: Response<any, Record<string, any>>; }'.
β”‚ Types of property 'req' are incompatible.
β”‚ Type 'IncomingMessage' is missing the following properties from type 'Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>': get, header, accepts, acceptsCharsets, and 26 more.
does anyone know how can I fix this and make it compatible with my opts?
8 replies
TtRPC
Created by acronie on 9/20/2023 in #❓-help
Showing pending inside the request?
I am using trpc with nextjs but when I am using hooks they're just not returning anything? Like it makes the request but it goes as pending and just blocks everything
18 replies
TTCTheo's Typesafe Cult
Created by acronie on 9/20/2023 in #questions
Trying to use upload thing
export const { Uploader, UploadButton, UploadDropzone } =
generateComponents<UploadFileRouter>();
export const { Uploader, UploadButton, UploadDropzone } =
generateComponents<UploadFileRouter>();
when I try to use these component it still says pass generic?
8 replies
TtRPC
Created by acronie on 9/7/2023 in #❓-help
Bad request in prod but works fine in dev
in prod I am getting BAD REQUEST
39 replies