db/insert
Documentation
- source: db/insert.ts
Overview
Classes
Insert
execute()
Executes a single parameterized INSERT statement. *
tsstatic execute(sql: string, parameters: any, datasourceName: string): void;
Parameter Type Description sqlstringThe SQL query to execute, with '?' placeholders for parameters. parametersanyAn optional array of values to replace the '?' placeholders. datasourceNamestringThe name of the database connection to use (optional). Returns
- Type:
void- Description: An array of records representing the result of the insertion (e.g., generated keys).
executeMany()
Executes multiple parameterized INSERT statements as a batch operation. *
tsstatic executeMany(sql: string, parameters: any, datasourceName: string): void;
Parameter Type Description sqlstringThe SQL query to execute, with '?' placeholders for parameters. parametersanyAn optional array of parameter arrays, where each inner array corresponds to one execution of the SQL statement. datasourceNamestringThe name of the database connection to use (optional). Returns
- Type:
void- Description: An array of records representing the results of the batched insertions.
