drizzle-orm-knex
Advanced tools
Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "drizzle-orm-knex", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "", | ||
@@ -12,5 +12,5 @@ "main": "src/index.ts", | ||
"devDependencies": { | ||
"drizzle-orm": "^0.9.15", | ||
"drizzle-orm": "^0.10.42", | ||
"knex": "^0.95.15" | ||
} | ||
} |
import { QueryResult } from "pg"; | ||
import { ISession } from 'drizzle-orm/db/session' | ||
import { Knex } from 'knex'; | ||
export class KnexSession extends ISession { | ||
public constructor(private knex: any) { | ||
public constructor(private knex: Knex) { | ||
super(); | ||
} | ||
public execute(query: string): Promise<QueryResult<any>> { | ||
return this.knex.raw(query); | ||
public execute(query: string, values?: Array<any>): Promise<QueryResult<any>> { | ||
return this.knex.raw(query, values ?? []) | ||
} | ||
parametrized(_: number): string { | ||
return "?" | ||
} | ||
} |
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
729
13
0