execute() — drizzle-orm Function Reference
Architecture documentation for the execute() function in session.ts from the drizzle-orm codebase.
Entity Profile
Dependency Diagram
graph TD a640529e_04d5_353c_4fc6_fb3eac16632d["execute()"] d351aaf5_212b_70bc_86f8_c0a8a986cf97["XataHttpPreparedQuery"] a640529e_04d5_353c_4fc6_fb3eac16632d -->|defined in| d351aaf5_212b_70bc_86f8_c0a8a986cf97 style a640529e_04d5_353c_4fc6_fb3eac16632d fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
drizzle-orm/src/xata-http/session.ts lines 47–69
async execute(placeholderValues: Record<string, unknown> | undefined = {}): Promise<T['execute']> {
const params = fillPlaceholders(this.query.params, placeholderValues);
this.logger.logQuery(this.query.sql, params);
const { fields, client, query, customResultMapper, joinsNotNullableMap } = this;
if (!fields && !customResultMapper) {
return this.queryWithCache(query.sql, params, async () => {
return await client.sql<Record<string, any>>({ statement: query.sql, params });
});
}
const { rows, warning } = await this.queryWithCache(query.sql, params, async () => {
return await client.sql({ statement: query.sql, params, responseType: 'array' });
});
if (warning) console.warn(warning);
return customResultMapper
? customResultMapper(rows as unknown[][])
: rows.map((row) => mapResultRow<T['execute']>(fields!, row as unknown[], joinsNotNullableMap));
}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does execute() do?
execute() is a function in the drizzle-orm codebase, defined in drizzle-orm/src/xata-http/session.ts.
Where is execute() defined?
execute() is defined in drizzle-orm/src/xata-http/session.ts at line 47.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free