@oino-ts/db-mariadb 0.2.0 → 0.3.1
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.
|
@@ -353,8 +353,11 @@ ORDER BY C.ORDINAL_POSITION;`;
|
|
|
353
353
|
isAutoInc: extra.indexOf('auto_increment') >= 0,
|
|
354
354
|
isNotNull: row[2] == "NO"
|
|
355
355
|
};
|
|
356
|
-
if (
|
|
356
|
+
if (api.isFieldIncluded(field_name) == false) {
|
|
357
357
|
db_1.OINOLog.info("OINODbMariadb.initializeApiDatamodel: field excluded in API parameters.", { field: field_name });
|
|
358
|
+
if (field_params.isPrimaryKey) {
|
|
359
|
+
throw new Error(db_1.OINO_ERROR_PREFIX + "Primary key field excluded in API parameters: " + field_name);
|
|
360
|
+
}
|
|
358
361
|
}
|
|
359
362
|
else {
|
|
360
363
|
// OINOLog.debug("OINODbMariadb.initializeApiDatamodel: next field ", {field_name: field_name, sql_type:sql_type, field_length1:field_length1, field_length2:field_length2, field_params:field_params })
|
|
@@ -350,8 +350,11 @@ ORDER BY C.ORDINAL_POSITION;`;
|
|
|
350
350
|
isAutoInc: extra.indexOf('auto_increment') >= 0,
|
|
351
351
|
isNotNull: row[2] == "NO"
|
|
352
352
|
};
|
|
353
|
-
if (
|
|
353
|
+
if (api.isFieldIncluded(field_name) == false) {
|
|
354
354
|
OINOLog.info("OINODbMariadb.initializeApiDatamodel: field excluded in API parameters.", { field: field_name });
|
|
355
|
+
if (field_params.isPrimaryKey) {
|
|
356
|
+
throw new Error(OINO_ERROR_PREFIX + "Primary key field excluded in API parameters: " + field_name);
|
|
357
|
+
}
|
|
355
358
|
}
|
|
356
359
|
else {
|
|
357
360
|
// OINOLog.debug("OINODbMariadb.initializeApiDatamodel: next field ", {field_name: field_name, sql_type:sql_type, field_length1:field_length1, field_length2:field_length2, field_params:field_params })
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oino-ts/db-mariadb",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "OINO TS package for using Mariadb databases.",
|
|
5
5
|
"author": "Matias Kiviniemi (pragmatta)",
|
|
6
6
|
"license": "MPL-2.0",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"module": "./dist/esm/index.js",
|
|
22
22
|
"types": "./dist/types/index.d.ts",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@oino-ts/db": "^0.
|
|
24
|
+
"@oino-ts/db": "^0.3.1",
|
|
25
25
|
"mariadb": "^3.2.3"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
package/src/OINODbMariadb.ts
CHANGED
|
@@ -372,8 +372,12 @@ ORDER BY C.ORDINAL_POSITION;`
|
|
|
372
372
|
isAutoInc: extra.indexOf('auto_increment') >= 0,
|
|
373
373
|
isNotNull: row[2] == "NO"
|
|
374
374
|
}
|
|
375
|
-
if (
|
|
375
|
+
if (api.isFieldIncluded(field_name)==false) {
|
|
376
376
|
OINOLog.info("OINODbMariadb.initializeApiDatamodel: field excluded in API parameters.", {field:field_name})
|
|
377
|
+
if (field_params.isPrimaryKey) {
|
|
378
|
+
throw new Error(OINO_ERROR_PREFIX + "Primary key field excluded in API parameters: " + field_name)
|
|
379
|
+
}
|
|
380
|
+
|
|
377
381
|
} else {
|
|
378
382
|
// OINOLog.debug("OINODbMariadb.initializeApiDatamodel: next field ", {field_name: field_name, sql_type:sql_type, field_length1:field_length1, field_length2:field_length2, field_params:field_params })
|
|
379
383
|
if ((sql_type == "int") || (sql_type == "smallint") || (sql_type == "float") || (sql_type == "double")) {
|