drizzle-orm
Advanced tools
@@ -20,2 +20,3 @@ import type { FullQueryResults, NeonQueryFunction } from '@neondatabase/serverless'; | ||
static readonly [entityKind]: string; | ||
private clientQuery; | ||
constructor(client: NeonHttpClient, query: Query, logger: Logger, fields: SelectedFieldsOrdered | undefined, _isResponseInArrayMode: boolean, customResultMapper?: ((rows: unknown[][]) => T["execute"]) | undefined); | ||
@@ -35,2 +36,3 @@ execute(placeholderValues: Record<string, unknown> | undefined): Promise<T['execute']>; | ||
static readonly [entityKind]: string; | ||
private clientQuery; | ||
private logger; | ||
@@ -37,0 +39,0 @@ constructor(client: NeonHttpClient, dialect: PgDialect, schema: RelationalSchemaConfig<TSchema> | undefined, options?: NeonHttpSessionOptions); |
@@ -23,4 +23,6 @@ import { entityKind } from "../entity.js"; | ||
this.customResultMapper = customResultMapper; | ||
this.clientQuery = client.query ?? client; | ||
} | ||
static [entityKind] = "NeonHttpPreparedQuery"; | ||
clientQuery; | ||
/** @internal */ | ||
@@ -30,5 +32,5 @@ async execute(placeholderValues = {}, token = this.authToken) { | ||
this.logger.logQuery(this.query.sql, params); | ||
const { fields, client, query, customResultMapper } = this; | ||
const { fields, clientQuery, query, customResultMapper } = this; | ||
if (!fields && !customResultMapper) { | ||
return client( | ||
return clientQuery( | ||
query.sql, | ||
@@ -42,3 +44,3 @@ params, | ||
} | ||
const result = await client( | ||
const result = await clientQuery( | ||
query.sql, | ||
@@ -66,3 +68,3 @@ params, | ||
this.logger.logQuery(this.query.sql, params); | ||
return this.client( | ||
return this.clientQuery( | ||
this.query.sql, | ||
@@ -80,3 +82,3 @@ params, | ||
this.logger.logQuery(this.query.sql, params); | ||
return this.client(this.query.sql, params, { arrayMode: true, fullResults: true, authToken: token }).then((result) => result.rows); | ||
return this.clientQuery(this.query.sql, params, { arrayMode: true, fullResults: true, authToken: token }).then((result) => result.rows); | ||
} | ||
@@ -94,5 +96,7 @@ /** @internal */ | ||
this.options = options; | ||
this.clientQuery = client.query ?? client; | ||
this.logger = options.logger ?? new NoopLogger(); | ||
} | ||
static [entityKind] = "NeonHttpSession"; | ||
clientQuery; | ||
logger; | ||
@@ -117,3 +121,3 @@ prepareQuery(query, fields, name, isResponseInArrayMode, customResultMapper) { | ||
builtQueries.push( | ||
this.client(builtQuery.sql, builtQuery.params, { | ||
this.clientQuery(builtQuery.sql, builtQuery.params, { | ||
fullResults: true, | ||
@@ -130,3 +134,3 @@ arrayMode: preparedQuery.isResponseInArrayMode() | ||
this.logger.logQuery(query, params); | ||
const result = await this.client(query, params, { arrayMode: true, fullResults: true }); | ||
const result = await this.clientQuery(query, params, { arrayMode: true, fullResults: true }); | ||
return result; | ||
@@ -136,3 +140,3 @@ } | ||
async queryObjects(query, params) { | ||
return this.client(query, params, { arrayMode: false, fullResults: true }); | ||
return this.clientQuery(query, params, { arrayMode: false, fullResults: true }); | ||
} | ||
@@ -139,0 +143,0 @@ /** @internal */ |
@@ -1,2 +0,2 @@ | ||
var version = "0.40.0"; | ||
var version = "0.40.1"; | ||
@@ -3,0 +3,0 @@ declare const compatibilityVersion = 10; |
// package.json | ||
var version = "0.40.0"; | ||
var version = "0.40.1"; | ||
@@ -4,0 +4,0 @@ // src/version.ts |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
9809186
0.02%95201
0.01%