db-crud-api 0.1.5 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/mssql.js CHANGED
@@ -1,268 +1,268 @@
1
- 'use strict';
2
-
3
- import sql from 'mssql';
4
-
5
- const pools = {};
6
-
7
- // Common
8
- function stringifyValue(fieldName, value, tSchema) {
9
- if (!value) { return 'null' }
10
- if (value.trimStart().charAt(0) !== '[') {
11
- if (tSchema.table.fields && tSchema.table.fields[fieldName] && tSchema.table.fields[fieldName].type) {
12
- if (tSchema.table.fields[fieldName].type == 'datetime') {
13
- if (typeof value == 'datetime') return `\'${value.toISOString()}\'`;
14
- if (typeof value == 'string' && value.trimStart().charAt(0) !== '\'' && value.trimStart().charAt(0) !== '\"') return `\'${value}\'`;
15
- return value;
16
- }
17
- if (tSchema.table.fields[fieldName].type == 'boolean' && typeof value == 'boolean') return `\'${value}\'`;
18
- if (tSchema.table.fields[fieldName].type == 'string' && value.trimStart().charAt(0) !== '\'' && value.trimStart().charAt(0) !== '\"') return `\'${value}\'`;
19
- if (tSchema.table.fields[fieldName].type == 'uuid' && value.trimStart().charAt(0) !== '\'' && value.trimStart().charAt(0) !== '\"') return `\'${value}\'`;
20
- }
21
- else {
22
- // if (typeof value == 'datetime') return `\'${value.toISOString()}\'`;
23
- if (typeof value == 'boolean') return `\'${value}\'`;
24
- if (typeof value == 'string' && value.trimStart().charAt(0) !== '\'' && value.trimStart().charAt(0) !== '\"') return `\'${value}\'`;
25
- }
26
- }
27
- return value;
28
- }
29
-
30
- // Create config object for pool
31
- export function prepareConnection(tSchema) {
32
- return {
33
- id: `${tSchema.server.realName}-${tSchema.database.realName}-${tSchema.server.user}`,
34
- server: ((tSchema.server.instance && tSchema.server.instance != 'DEFAULT') ? (tSchema.server.realName + '\\' + tSchema.server.instance) : tSchema.server.realName) ?? 'localhost',
35
- port: tSchema.server.port,
36
- user: tSchema.server.user,
37
- password: tSchema.server.password,
38
- options: {
39
- appName: tSchema.server.options?.appName,
40
- encrypt: tSchema.server.options?.encrypt ?? false, // true for azure
41
- trustServerCertificate: tSchema.server.options?.trustServerCertificate ?? true // true for local dev / self-signed certs
42
- },
43
- database: tSchema.database.realName
44
- };
45
- };
46
-
47
- // Close connection
48
- export async function closeConnection(connection) {
49
- let pool = pools[connection.id];
50
- if (pool) {
51
- await pool.close(); // wait pool is closed
52
- pools[connection.id] = undefined; // remove pool from pools
53
- }
54
- }
55
-
56
- // Close all connections
57
- export async function closeAllConnections() {
58
- for (let poolId in pools) {
59
- if (!pools.hasOwnProperty(poolId)) continue;
60
- let pool = pools[poolId];
61
- if (pool) {
62
- await pool.close(); // wait pool is closed
63
- pool = undefined; // remove pool from pools
64
- }
65
- }
66
- }
67
-
68
- // Query
69
- export async function query(connection, dbOpes) {
70
-
71
- // Prepare pool
72
- let pool = pools[connection.id]; // Try to get an existing pool
73
- if (!pool) {
74
- pool = new sql.ConnectionPool(connection); // Create new pool
75
- await pool.connect(); // wait that connection are made
76
- pools[connection.id] = pool; // add new pool to pools
77
- }
78
-
79
- // Prepare sql statement
80
- let sqlString = '';
81
- let sqlRequest = pool.request();
82
- if (Array.isArray(dbOpes))
83
- dbOpes.forEach((dbOpe, index) => {
84
- if (index > 0) sqlString += '; '
85
- sqlString += ToSql(dbOpe, sqlRequest); // if exists, input params will be added to request
86
- });
87
- else sqlString += ToSql(dbOpes, sqlRequest);
88
-
89
- // Run query
90
- const sqlresult = await sqlRequest.query(sqlString);
91
-
92
- // Return result
93
- return sqlresult;
94
- }
95
-
96
- // Normalize field name
97
- //function toFieldName(s) {
98
- // if ( s.trimStart().charAt(0) === '[' ) return s;
99
- // else return `\[${s}\]`;
100
- //}
101
-
102
- // Compose fully qualified table name
103
- function fullyQualifiedTableName(tSchema) {
104
- return (tSchema.database.realName + '.' + (tSchema.table.schema ?? '') + '.' + tSchema.table.realName);
105
- }
106
-
107
- // Parse oprations object to sql string
108
- function ToSql(dbOpe, sqlRequest) {
109
- if (dbOpe.get) return getToSql(dbOpe, sqlRequest);
110
- if (dbOpe.patch) return patchToSql(dbOpe, sqlRequest);
111
- if (dbOpe.put) return putToSql(dbOpe, sqlRequest);
112
- if (dbOpe.delete) return deleteToSql(dbOpe, sqlRequest);
113
- if (dbOpe.execute) return executeToSql(dbOpe, sqlRequest);
114
- if (dbOpe.begin) return beginToSql(dbOpe, sqlRequest);
115
- if (dbOpe.commit) return commitToSql(dbOpe, sqlRequest);
116
- if (dbOpe.rollback) return rollbackToSql(dbOpe, sqlRequest);
117
- if (dbOpe.passthrough) return passthroughToSql(dbOpe, sqlRequest);
118
- }
119
-
120
- // Parse operation object to sql string without any trasformation.
121
- function passthroughToSql(dbOpe, sqlRequest) {
122
-
123
- let result = "";
124
-
125
- if (dbOpe.passthrough.command) {
126
- result += dbOpe.passthrough.command;
127
- }
128
- else { throw new Error('command is missing.'); }
129
-
130
- if (dbOpe.passthrough.params) addParams(dbOpe.passthrough.params, sqlRequest);
131
-
132
- return result;
133
- }
134
-
135
- // Parse get operation object to sql string
136
- function getToSql(dbOpe, sqlRequest) {
137
- let _first = true;
138
-
139
- let result = 'select '
140
-
141
- if ((dbOpe.get.options) && (Object.keys(dbOpe.get.options).length > 0)) {
142
- if (Array.isArray(dbOpe.get.options)) result += dbOpe.get.options.join(' ') + ' ';
143
- else result += dbOpe.get.options + ' ';
144
- }
145
-
146
- if ((dbOpe.get.fields) && (Object.keys(dbOpe.get.fields).length > 0)) {
147
- if (Array.isArray(dbOpe.get.fields)) result += dbOpe.get.fields.join(', ');
148
- else result += dbOpe.get.fields;
149
- }
150
- else { throw new Error('fields is missing.'); }
151
-
152
- result += ' from ' + fullyQualifiedTableName(dbOpe.get.schema);
153
-
154
- if ((dbOpe.get.filters) && (Object.keys(dbOpe.get.filters).length > 0)) {
155
- if (Array.isArray(dbOpe.get.filters)) result += ' where ' + dbOpe.get.filters.join(' ');
156
- else result += ' where ' + dbOpe.get.filters;
157
- }
158
-
159
- if ((dbOpe.get.groups) && (Object.keys(dbOpe.get.groups).length > 0)) {
160
- if (Array.isArray(dbOpe.get.groups)) result += ' group by ' + dbOpe.get.groups.join(', ');
161
- else result += ' group by ' + dbOpe.get.groups;
162
- }
163
-
164
- if ((dbOpe.get.groupsFilters) && (Object.keys(dbOpe.get.groupsFilters).length > 0)) {
165
- if (Array.isArray(dbOpe.get.groupsFilters)) result += ' having ' + dbOpe.get.groupsFilters.join(' ');
166
- else result += ' having ' + dbOpe.get.groupsFilters;
167
- }
168
-
169
- if ((dbOpe.get.orderBy) && (Object.keys(dbOpe.get.orderBy).length > 0)) {
170
- if (Array.isArray(dbOpe.get.orderBy)) result += ' order by ' + dbOpe.get.orderBy.join(', ');
171
- else result += ' order by ' + dbOpe.get.orderBy;
172
- }
173
-
174
- if (dbOpe.get.params) addParams(dbOpe.get.params, sqlRequest);
175
-
176
- return result;
177
- }
178
-
179
- // Parse patch operation object to sql string
180
- function patchToSql(dbOpe, sqlRequest) {
181
- let result = 'update ' + fullyQualifiedTableName(dbOpe.patch.schema);
182
-
183
- if (dbOpe.patch.sets) { result += ' set ' + Object.entries(dbOpe.patch.sets).map(e => { return e[0] + '=' + stringifyValue(e[0], e[1], dbOpe.patch.schema) }).join(', '); }
184
- else { throw new Error('sets is missing.'); }
185
-
186
- if ((dbOpe.patch.filters) && (Object.keys(dbOpe.patch.filters).length > 0)) {
187
- if (Array.isArray(dbOpe.patch.filters)) result += ' where ' + dbOpe.patch.filters.join(' ');
188
- else result += ' where ' + dbOpe.patch.filters;
189
- }
190
-
191
- if (dbOpe.patch.params) addParams(dbOpe.patch.params, sqlRequest);
192
-
193
- return result;
194
- }
195
-
196
- // Parse put (add) operation object to sql string
197
- function putToSql(dbOpe, sqlRequest) {
198
- let result = 'insert into ' + fullyQualifiedTableName(dbOpe.put.schema);
199
-
200
- if ((dbOpe.put.sets) && (Object.keys(dbOpe.put.sets).length > 0)) {
201
- let result_f = ' ('; let result_v = ' values (';
202
- let _first = true;
203
- for (const [key, value] of Object.entries(dbOpe.put.sets)) {
204
- if (!_first) { result_f += ', '; result_v += ', '; } else { _first = false }
205
- if (key || value) { result_f += key; result_v += stringifyValue(key, value, dbOpe.put.schema); }
206
- }
207
- result_f += ')'; result_v += ')';
208
- result += result_f + result_v;
209
- }
210
- else { throw new Error('sets is missing.'); }
211
-
212
- if (dbOpe.put.params) addParams(dbOpe.put.params, sqlRequest);
213
-
214
- return result;
215
- }
216
-
217
- // Parse delete operation object to sql string
218
- function deleteToSql(dbOpe, sqlRequest) {
219
- let result = 'delete from ' + fullyQualifiedTableName(dbOpe.delete.schema);
220
-
221
- if ((dbOpe.delete.filters) && (Object.keys(dbOpe.delete.filters).length > 0)) {
222
- if (Array.isArray(dbOpe.delete.filters)) result += ' where ' + dbOpe.delete.filters.join(' ');
223
- else result += ' where ' + dbOpe.delete.filters;
224
- }
225
-
226
- if (dbOpe.delete.params) addParams(dbOpe.delete.params, sqlRequest);
227
-
228
- return result;
229
- }
230
-
231
- // Parse execute operation object to sql string
232
- function executeToSql(dbOpe, sqlRequest) {
233
- let result = "execute ";
234
-
235
- if (dbOpe.execute.command) {
236
- result += dbOpe.execute.command;
237
- }
238
- else { throw new Error('command is missing.'); }
239
-
240
- if (dbOpe.execute.params) addParams(dbOpe.execute.params, sqlRequest);
241
-
242
- return result;
243
- }
244
-
245
- // Parse begin operation object to sql string
246
- function beginToSql(dbOpe, sqlRequest) {
247
- return "BEGIN TRANSACTION";
248
- }
249
-
250
- // Parse commit operation object to sql string
251
- function commitToSql(dbOpe, sqlRequest) {
252
- return "COMMIT";
253
- }
254
-
255
- // Parse rollback operation object to sql string
256
- function rollbackToSql(dbOpe, sqlRequest) {
257
- return "ROLLBACK";
258
- }
259
-
260
- // Add input parameters to pool.request
261
- function addParams(params, sqlRequest) {
262
- if (params) {
263
- for (const [key, value] of Object.entries(params)) {
264
- sqlRequest.input(key, value)
265
- }
266
- }
267
- return;
1
+ 'use strict';
2
+
3
+ import sql from 'mssql';
4
+
5
+ const pools = {};
6
+
7
+ // Common
8
+ function stringifyValue(fieldName, value, tSchema) {
9
+ if (value == undefined) { return 'null' }
10
+ if (typeof value !== 'string' || value.trimStart().charAt(0) !== '[') {
11
+ if (tSchema.table.fields && tSchema.table.fields[fieldName] && tSchema.table.fields[fieldName].type) {
12
+ if (tSchema.table.fields[fieldName].type == 'datetime') {
13
+ if (typeof value == 'datetime' || typeof value == 'object') return `\'${value.toISOString()}\'`;
14
+ if (typeof value == 'string' && value.trimStart().charAt(0) !== '\'' && value.trimStart().charAt(0) !== '\"') return `\'${value}\'`;
15
+ return value;
16
+ }
17
+ if (tSchema.table.fields[fieldName].type == 'boolean' && typeof value == 'boolean') return `\'${value}\'`;
18
+ if (tSchema.table.fields[fieldName].type == 'string' && value.trimStart().charAt(0) !== '\'' && value.trimStart().charAt(0) !== '\"') return `\'${value}\'`;
19
+ if (tSchema.table.fields[fieldName].type == 'uuid' && value.trimStart().charAt(0) !== '\'' && value.trimStart().charAt(0) !== '\"') return `\'${value}\'`;
20
+ }
21
+ else {
22
+ // if (typeof value == 'datetime') return `\'${value.toISOString()}\'`;
23
+ if (typeof value == 'boolean') return `\'${value}\'`;
24
+ if (typeof value == 'string' && value.trimStart().charAt(0) !== '\'' && value.trimStart().charAt(0) !== '\"') return `\'${value}\'`;
25
+ }
26
+ }
27
+ return value;
28
+ }
29
+
30
+ // Create config object for pool
31
+ export function prepareConnection(tSchema) {
32
+ return {
33
+ id: `${tSchema.server.realName}-${tSchema.database.realName}-${tSchema.server.user}`,
34
+ server: ((tSchema.server.instance && tSchema.server.instance != 'DEFAULT') ? (tSchema.server.realName + '\\' + tSchema.server.instance) : tSchema.server.realName) ?? 'localhost',
35
+ port: tSchema.server.port,
36
+ user: tSchema.server.user,
37
+ password: tSchema.server.password,
38
+ options: {
39
+ appName: tSchema.server.options?.appName,
40
+ encrypt: tSchema.server.options?.encrypt ?? false, // true for azure
41
+ trustServerCertificate: tSchema.server.options?.trustServerCertificate ?? true // true for local dev / self-signed certs
42
+ },
43
+ database: tSchema.database.realName
44
+ };
45
+ };
46
+
47
+ // Close connection
48
+ export async function closeConnection(connection) {
49
+ let pool = pools[connection.id];
50
+ if (pool) {
51
+ await pool.close(); // wait pool is closed
52
+ pools[connection.id] = undefined; // remove pool from pools
53
+ }
54
+ }
55
+
56
+ // Close all connections
57
+ export async function closeAllConnections() {
58
+ for (let poolId in pools) {
59
+ if (!pools.hasOwnProperty(poolId)) continue;
60
+ let pool = pools[poolId];
61
+ if (pool) {
62
+ await pool.close(); // wait pool is closed
63
+ pool = undefined; // remove pool from pools
64
+ }
65
+ }
66
+ }
67
+
68
+ // Query
69
+ export async function query(connection, dbOpes) {
70
+
71
+ // Prepare pool
72
+ let pool = pools[connection.id]; // Try to get an existing pool
73
+ if (!pool) {
74
+ pool = new sql.ConnectionPool(connection); // Create new pool
75
+ await pool.connect(); // wait that connection are made
76
+ pools[connection.id] = pool; // add new pool to pools
77
+ }
78
+
79
+ // Prepare sql statement
80
+ let sqlString = '';
81
+ let sqlRequest = pool.request();
82
+ if (Array.isArray(dbOpes))
83
+ dbOpes.forEach((dbOpe, index) => {
84
+ if (index > 0) sqlString += '; '
85
+ sqlString += ToSql(dbOpe, sqlRequest); // if exists, input params will be added to request
86
+ });
87
+ else sqlString += ToSql(dbOpes, sqlRequest);
88
+
89
+ // Run query
90
+ const sqlresult = await sqlRequest.query(sqlString);
91
+
92
+ // Return result
93
+ return sqlresult;
94
+ }
95
+
96
+ // Normalize field name
97
+ //function toFieldName(s) {
98
+ // if ( s.trimStart().charAt(0) === '[' ) return s;
99
+ // else return `\[${s}\]`;
100
+ //}
101
+
102
+ // Compose fully qualified table name
103
+ function fullyQualifiedTableName(tSchema) {
104
+ return (tSchema.database.realName + '.' + (tSchema.table.schema ?? '') + '.' + tSchema.table.realName);
105
+ }
106
+
107
+ // Parse oprations object to sql string
108
+ function ToSql(dbOpe, sqlRequest) {
109
+ if (dbOpe.get) return getToSql(dbOpe, sqlRequest);
110
+ if (dbOpe.patch) return patchToSql(dbOpe, sqlRequest);
111
+ if (dbOpe.put) return putToSql(dbOpe, sqlRequest);
112
+ if (dbOpe.delete) return deleteToSql(dbOpe, sqlRequest);
113
+ if (dbOpe.execute) return executeToSql(dbOpe, sqlRequest);
114
+ if (dbOpe.begin) return beginToSql(dbOpe, sqlRequest);
115
+ if (dbOpe.commit) return commitToSql(dbOpe, sqlRequest);
116
+ if (dbOpe.rollback) return rollbackToSql(dbOpe, sqlRequest);
117
+ if (dbOpe.passthrough) return passthroughToSql(dbOpe, sqlRequest);
118
+ }
119
+
120
+ // Parse operation object to sql string without any trasformation.
121
+ function passthroughToSql(dbOpe, sqlRequest) {
122
+
123
+ let result = "";
124
+
125
+ if (dbOpe.passthrough.command) {
126
+ result += dbOpe.passthrough.command;
127
+ }
128
+ else { throw new Error('command is missing.'); }
129
+
130
+ if (dbOpe.passthrough.params) addParams(dbOpe.passthrough.params, sqlRequest);
131
+
132
+ return result;
133
+ }
134
+
135
+ // Parse get operation object to sql string
136
+ function getToSql(dbOpe, sqlRequest) {
137
+ let _first = true;
138
+
139
+ let result = 'select '
140
+
141
+ if ((dbOpe.get.options) && (Object.keys(dbOpe.get.options).length > 0)) {
142
+ if (Array.isArray(dbOpe.get.options)) result += dbOpe.get.options.join(' ') + ' ';
143
+ else result += dbOpe.get.options + ' ';
144
+ }
145
+
146
+ if ((dbOpe.get.fields) && (Object.keys(dbOpe.get.fields).length > 0)) {
147
+ if (Array.isArray(dbOpe.get.fields)) result += dbOpe.get.fields.join(', ');
148
+ else result += dbOpe.get.fields;
149
+ }
150
+ else { throw new Error('fields is missing.'); }
151
+
152
+ result += ' from ' + fullyQualifiedTableName(dbOpe.get.schema);
153
+
154
+ if ((dbOpe.get.filters) && (Object.keys(dbOpe.get.filters).length > 0)) {
155
+ if (Array.isArray(dbOpe.get.filters)) result += ' where ' + dbOpe.get.filters.join(' ');
156
+ else result += ' where ' + dbOpe.get.filters;
157
+ }
158
+
159
+ if ((dbOpe.get.groups) && (Object.keys(dbOpe.get.groups).length > 0)) {
160
+ if (Array.isArray(dbOpe.get.groups)) result += ' group by ' + dbOpe.get.groups.join(', ');
161
+ else result += ' group by ' + dbOpe.get.groups;
162
+ }
163
+
164
+ if ((dbOpe.get.groupsFilters) && (Object.keys(dbOpe.get.groupsFilters).length > 0)) {
165
+ if (Array.isArray(dbOpe.get.groupsFilters)) result += ' having ' + dbOpe.get.groupsFilters.join(' ');
166
+ else result += ' having ' + dbOpe.get.groupsFilters;
167
+ }
168
+
169
+ if ((dbOpe.get.orderBy) && (Object.keys(dbOpe.get.orderBy).length > 0)) {
170
+ if (Array.isArray(dbOpe.get.orderBy)) result += ' order by ' + dbOpe.get.orderBy.join(', ');
171
+ else result += ' order by ' + dbOpe.get.orderBy;
172
+ }
173
+
174
+ if (dbOpe.get.params) addParams(dbOpe.get.params, sqlRequest);
175
+
176
+ return result;
177
+ }
178
+
179
+ // Parse patch operation object to sql string
180
+ function patchToSql(dbOpe, sqlRequest) {
181
+ let result = 'update ' + fullyQualifiedTableName(dbOpe.patch.schema);
182
+
183
+ if (dbOpe.patch.sets) { result += ' set ' + Object.entries(dbOpe.patch.sets).map(e => { return e[0] + '=' + stringifyValue(e[0], e[1], dbOpe.patch.schema) }).join(', '); }
184
+ else { throw new Error('sets is missing.'); }
185
+
186
+ if ((dbOpe.patch.filters) && (Object.keys(dbOpe.patch.filters).length > 0)) {
187
+ if (Array.isArray(dbOpe.patch.filters)) result += ' where ' + dbOpe.patch.filters.join(' ');
188
+ else result += ' where ' + dbOpe.patch.filters;
189
+ }
190
+
191
+ if (dbOpe.patch.params) addParams(dbOpe.patch.params, sqlRequest);
192
+
193
+ return result;
194
+ }
195
+
196
+ // Parse put (add) operation object to sql string
197
+ function putToSql(dbOpe, sqlRequest) {
198
+ let result = 'insert into ' + fullyQualifiedTableName(dbOpe.put.schema);
199
+
200
+ if ((dbOpe.put.sets) && (Object.keys(dbOpe.put.sets).length > 0)) {
201
+ let result_f = ' ('; let result_v = ' values (';
202
+ let _first = true;
203
+ for (const [key, value] of Object.entries(dbOpe.put.sets)) {
204
+ if (!_first) { result_f += ', '; result_v += ', '; } else { _first = false }
205
+ if (key || value) { result_f += key; result_v += stringifyValue(key, value, dbOpe.put.schema); }
206
+ }
207
+ result_f += ')'; result_v += ')';
208
+ result += result_f + result_v;
209
+ }
210
+ else { throw new Error('sets is missing.'); }
211
+
212
+ if (dbOpe.put.params) addParams(dbOpe.put.params, sqlRequest);
213
+
214
+ return result;
215
+ }
216
+
217
+ // Parse delete operation object to sql string
218
+ function deleteToSql(dbOpe, sqlRequest) {
219
+ let result = 'delete from ' + fullyQualifiedTableName(dbOpe.delete.schema);
220
+
221
+ if ((dbOpe.delete.filters) && (Object.keys(dbOpe.delete.filters).length > 0)) {
222
+ if (Array.isArray(dbOpe.delete.filters)) result += ' where ' + dbOpe.delete.filters.join(' ');
223
+ else result += ' where ' + dbOpe.delete.filters;
224
+ }
225
+
226
+ if (dbOpe.delete.params) addParams(dbOpe.delete.params, sqlRequest);
227
+
228
+ return result;
229
+ }
230
+
231
+ // Parse execute operation object to sql string
232
+ function executeToSql(dbOpe, sqlRequest) {
233
+ let result = "execute ";
234
+
235
+ if (dbOpe.execute.command) {
236
+ result += dbOpe.execute.command;
237
+ }
238
+ else { throw new Error('command is missing.'); }
239
+
240
+ if (dbOpe.execute.params) addParams(dbOpe.execute.params, sqlRequest);
241
+
242
+ return result;
243
+ }
244
+
245
+ // Parse begin operation object to sql string
246
+ function beginToSql(dbOpe, sqlRequest) {
247
+ return "BEGIN TRANSACTION";
248
+ }
249
+
250
+ // Parse commit operation object to sql string
251
+ function commitToSql(dbOpe, sqlRequest) {
252
+ return "COMMIT";
253
+ }
254
+
255
+ // Parse rollback operation object to sql string
256
+ function rollbackToSql(dbOpe, sqlRequest) {
257
+ return "ROLLBACK";
258
+ }
259
+
260
+ // Add input parameters to pool.request
261
+ function addParams(params, sqlRequest) {
262
+ if (params) {
263
+ for (const [key, value] of Object.entries(params)) {
264
+ sqlRequest.input(key, value)
265
+ }
266
+ }
267
+ return;
268
268
  }
package/lib/schema.js CHANGED
@@ -1,4 +1,4 @@
1
- export default {
2
- servers: {
3
- }
1
+ export default {
2
+ servers: {
3
+ }
4
4
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "db-crud-api",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "type": "module",
5
5
  "description": "CRUD api for database tables",
6
6
  "main": "index.js",
@@ -12,5 +12,6 @@
12
12
  "dependencies": {
13
13
  "mssql": "^9.3.2",
14
14
  "uuid": "^9.0.1"
15
- }
15
+ },
16
+ "keywords":["db","crud","api"]
16
17
  }