SQL
Collection of SQL functions.
Methods
execute
execute(connectionString: string | {
Executes a T-SQL query. Returns an array of rows with columns as key/value pairs.
Parameters
connectionString *string | {
The connection string or object to the SQL database.
query string
The SQL statement to be executed.
params { name: string, value: any, type: SQL.TYPES }[]
(optional) Parameters to be used within the query. Use parameters to avoid SQL injection. See OWASP SQL Injection cheat sheet
Return type
{ [key: string]: any; }[]
Examples
executeStoredProcedure
executeStoredProcedure(connectionString: string | {
Executes a SQL Stored Procedure. Use parameters to avoid SQL injection. See OWASP SQL Injection cheat sheet
Parameters
connectionString *string | {
The connection string or object to the SQL database.
query string
The SQL statement to be executed.
params { name: string, value: any, type: SQL.TYPES }[]
(optional) Parameters to be used within the query. Use parameters to avoid SQL injection. See OWASP SQL Injection cheat sheet
Return type
{ [key: string]: any; }[]
Examples
Last updated