Skip to content

Commit

Permalink
fix: typos
Browse files Browse the repository at this point in the history
  • Loading branch information
Elin Angelow committed Dec 18, 2023
1 parent 20db663 commit 9afdd60
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 40 deletions.
2 changes: 1 addition & 1 deletion examples/mssql/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(async() => {
const methods = await require('../../lib/mssql')(
require('../mssql.config.js')
require('./config')
);
try {
await methods['dbo.Usp_InsertLesson']({ParLessonType: [{LessonId: 100, LessonName: 'example lesson'}]});
Expand Down
6 changes: 3 additions & 3 deletions examples/postgresql/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
(async() => {
const methods = await require('../../lib/mssql/index.js')(
require('../mssql.config.js')
const methods = await require('../../lib/postgresql')(
require('./config')
);
try {
await methods['dbo.Usp_InsertLesson']({ParLessonType: [{LessonId: 100, LessonName: 'example lesson'}]});
await methods['some-test-example/exsschema/fnLastTx"']({ParLessonType: [{LessonId: 100, LessonName: 'example lesson'}]});
} catch (e) {
console.error(e);
}
Expand Down
21 changes: 3 additions & 18 deletions lib/mssql/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ const stringToType = (() => {
})();

const conn = (() => {
let connection = null;
let connection;
return async(config) => {
if (connection === null) {
if (connection === undefined) {
connection = await driver.connect(config);
return connection;
}
Expand All @@ -45,22 +45,7 @@ const conn = (() => {


const Link = async(config) => {
const {
server,
user,
password,
database,
pool,
options
} = config;
const cPool = await conn({
server,
user,
password,
pool,
database,
options
});
const cPool = await conn(config);
return {
query: async(q) => {
try {
Expand Down
21 changes: 3 additions & 18 deletions lib/postgresql/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ const SqlWe = (() => (class Sql extends WError {}))();
const predefinedSql = require('./sqls/index.js');

const conn = (() => {
let connection = null;
let connection;
return async(config) => {
if (connection === null) {
if (connection === undefined) {
connection = await driver.connect(config);
return connection;
}
Expand All @@ -19,22 +19,7 @@ const conn = (() => {


const Link = async(config) => {
const {
server,
user,
password,
database,
pool,
options
} = config;
const cPool = await conn({
server,
user,
password,
pool,
database,
options
});
const cPool = await conn(config);
return {
query: async(q) => {
try {
Expand Down

0 comments on commit 9afdd60

Please sign in to comment.