const db = new Kysely<Database>({
dialect: new D1Dialect({ database: env.voting })
});
export interface User {
userId: string
votes: number;
lastVoted: number;
votes_this_month: number;
};
export interface Database {
voting: User;
}
No overload matches this call.
Overload 1 of 2, '(args: KyselyConfig): Kysely<Database>', gave the following error.
Type 'D1Dialect' is not assignable to type 'Dialect'.
The types of 'createAdapter().acquireMigrationLock' are incompatible between these types.
Type '(_db: Kysely<any>, _opt: MigrationLockOptions) => Promise<void>' is not assignable to type '(db: Kysely<any>, options: MigrationLockOptions) => Promise<void>'.
Types of parameters '_db' and 'db' are incompatible.
Type 'import("c:/Users/kyebm/OneDrive/Desktop/Desktop (1)/cf bot/node_modules/kysely/dist/esm/kysely", { with: { "resolution-mode": "import" } }).Kysely<any>' is not assignable to type 'import("c:/Users/kyebm/OneDrive/Desktop/Desktop (1)/cf bot/node_modules/kysely/dist/cjs/kysely").Kysely<any>'.
Property '#private' in type 'Kysely' refers to a different member that cannot be accessed from within type 'Kysely'.
Overload 2 of 2, '(args: KyselyProps): Kysely<Database>', gave the following error.
Type 'D1Dialect' is not assignable to type 'Dialect'.ts(2769)
const db = new Kysely<Database>({
dialect: new D1Dialect({ database: env.voting })
});
export interface User {
userId: string
votes: number;
lastVoted: number;
votes_this_month: number;
};
export interface Database {
voting: User;
}
No overload matches this call.
Overload 1 of 2, '(args: KyselyConfig): Kysely<Database>', gave the following error.
Type 'D1Dialect' is not assignable to type 'Dialect'.
The types of 'createAdapter().acquireMigrationLock' are incompatible between these types.
Type '(_db: Kysely<any>, _opt: MigrationLockOptions) => Promise<void>' is not assignable to type '(db: Kysely<any>, options: MigrationLockOptions) => Promise<void>'.
Types of parameters '_db' and 'db' are incompatible.
Type 'import("c:/Users/kyebm/OneDrive/Desktop/Desktop (1)/cf bot/node_modules/kysely/dist/esm/kysely", { with: { "resolution-mode": "import" } }).Kysely<any>' is not assignable to type 'import("c:/Users/kyebm/OneDrive/Desktop/Desktop (1)/cf bot/node_modules/kysely/dist/cjs/kysely").Kysely<any>'.
Property '#private' in type 'Kysely' refers to a different member that cannot be accessed from within type 'Kysely'.
Overload 2 of 2, '(args: KyselyProps): Kysely<Database>', gave the following error.
Type 'D1Dialect' is not assignable to type 'Dialect'.ts(2769)