Skip to content

Commit

Permalink
#50 Minor renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
czprz committed Apr 2, 2022
1 parent d6a002a commit 1463047
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions bin/common/helper/mssql.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ module.exports = new class {
}

/**
* INSERT INTO mssql command
* Inserts data into existing table
* @param query {DbQuery}
* @returns {Promise<void>}
*/
async insertInto(query) {
async insert(query) {
await this.#connect(query);
const insert = this.#mapDbDataToInsertQuery(query.data);
await sql.query(`INSERT INTO ${insert}`);
Expand Down
6 changes: 3 additions & 3 deletions bin/environments/executions/mssql/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = new class {
await this.#createTable(execution);
break;
case "insert":
await this.#insertInto(execution);
await this.#insert(execution);
break;
default:
console.error(`mssql: option '${execution.sql.option}' not supported`);
Expand Down Expand Up @@ -85,7 +85,7 @@ module.exports = new class {
* @param execution {Execution}
* @returns {Promise<void>}
*/
async #insertInto(execution) {
async #insert(execution) {
if (!execution.sql.database || execution.sql.table) {
console.log(`mssql: '${execution.name}' could not find database or table name`);
return;
Expand All @@ -102,7 +102,7 @@ module.exports = new class {
}

try {
await mssql.insertInto(execution.sql);
await mssql.insert(execution.sql);
console.log(`mssql: '${name}' :: insert into has completed successfully`);
} catch (e) {
console.error(`mssql: '${name}' :: insert into could not complete successfully`);
Expand Down

0 comments on commit 1463047

Please sign in to comment.