@oino-ts/db-mssql 0.10.1 → 0.10.2
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/README.md +2 -2
- package/dist/cjs/OINODbMsSql.js +1 -1
- package/dist/esm/OINODbMsSql.js +1 -1
- package/package.json +2 -2
- package/src/OINODbMsSql.ts +1 -1
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ import { OINODbBunSqlite } from "@oino-ts/db-bunsqlite"
|
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
### Register database and logger
|
|
25
|
-
Register your database implementation and logger (see [`OINOConsoleLog`](https://pragmatta.github.io/oino-ts/classes/
|
|
25
|
+
Register your database implementation and logger (see [`OINOConsoleLog`](https://pragmatta.github.io/oino-ts/classes/common_src.OINOConsoleLog.html) how to implement your own)
|
|
26
26
|
|
|
27
27
|
```
|
|
28
28
|
OINOLog.setLogger(new OINOConsoleLog())
|
|
@@ -103,7 +103,7 @@ Currently supported databases:
|
|
|
103
103
|
To support tables with multipart primary keys OINO generates a composite key `_OINOID_` that is included in the result and can be used as the REST ID. For example in the example above table `OrderDetails` has two primary keys `OrderID` and `ProductID` making the `_OINOID_` of form `11077:99`.
|
|
104
104
|
|
|
105
105
|
## Power Of SQL
|
|
106
|
-
Since OINO is just generating SQL, WHERE-conditions can be defined with [`
|
|
106
|
+
Since OINO is just generating SQL, WHERE-conditions can be defined with [`OINODbSqlFilter`](https://pragmatta.github.io/oino-ts/classes/db_src.OINODbSqlFilter.html), order with [`OINODbSqlOrder`](https://pragmatta.github.io/oino-ts/classes/db_src.OINODbSqlOrder.html), limits/paging with [`OINODbSqlLimit`](https://pragmatta.github.io/oino-ts/classes/db_src.OINODbSqlLimit.html) and aggregation with [`OINODbSqlAggregate`](https://pragmatta.github.io/oino-ts/classes/db_src.OINODbSqlAggregate.html) that are passed as HTTP request parameters. No more API development where you make unique API endpoints for each filter that fetch all data with original API and filter in backend code. Every API can be filtered when and as needed without unnessecary data tranfer and utilizing SQL indexing when available.
|
|
107
107
|
|
|
108
108
|
## Swagger Support
|
|
109
109
|
Swagger is great as long as the definitions are updated and with OINO you can automatically get a Swagger definition including a data model schema.
|
package/dist/cjs/OINODbMsSql.js
CHANGED
|
@@ -256,7 +256,7 @@ class OINODbMsSql extends db_1.OINODb {
|
|
|
256
256
|
if ((limitCondition != "") && (limit_parts.length == 2)) {
|
|
257
257
|
if (orderCondition == "") {
|
|
258
258
|
db_1.OINOLog.error("@oino-ts/db-mssql", "OINODbMsSql", "printSqlSelect", "LIMIT without ORDER BY is not supported in MS SQL Server");
|
|
259
|
-
throw new Error(db_1.OINO_ERROR_PREFIX + "LIMIT without ORDER BY is not supported in MS SQL Server");
|
|
259
|
+
throw new Error(db_1.OINO_ERROR_PREFIX + ": LIMIT without ORDER BY is not supported in MS SQL Server");
|
|
260
260
|
}
|
|
261
261
|
else {
|
|
262
262
|
result += " OFFSET " + limit_parts[1] + " ROWS FETCH NEXT " + limit_parts[0] + " ROWS ONLY";
|
package/dist/esm/OINODbMsSql.js
CHANGED
|
@@ -253,7 +253,7 @@ export class OINODbMsSql extends OINODb {
|
|
|
253
253
|
if ((limitCondition != "") && (limit_parts.length == 2)) {
|
|
254
254
|
if (orderCondition == "") {
|
|
255
255
|
OINOLog.error("@oino-ts/db-mssql", "OINODbMsSql", "printSqlSelect", "LIMIT without ORDER BY is not supported in MS SQL Server");
|
|
256
|
-
throw new Error(OINO_ERROR_PREFIX + "LIMIT without ORDER BY is not supported in MS SQL Server");
|
|
256
|
+
throw new Error(OINO_ERROR_PREFIX + ": LIMIT without ORDER BY is not supported in MS SQL Server");
|
|
257
257
|
}
|
|
258
258
|
else {
|
|
259
259
|
result += " OFFSET " + limit_parts[1] + " ROWS FETCH NEXT " + limit_parts[0] + " ROWS ONLY";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oino-ts/db-mssql",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.2",
|
|
4
4
|
"description": "OINO TS package for using Microsoft Sql databases.",
|
|
5
5
|
"author": "Matias Kiviniemi (pragmatta)",
|
|
6
6
|
"license": "MPL-2.0",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"module": "./dist/esm/index.js",
|
|
23
23
|
"types": "./dist/types/index.d.ts",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@oino-ts/db": "0.10.
|
|
25
|
+
"@oino-ts/db": "0.10.2",
|
|
26
26
|
"mssql": "^11.0.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
package/src/OINODbMsSql.ts
CHANGED
|
@@ -275,7 +275,7 @@ export class OINODbMsSql extends OINODb {
|
|
|
275
275
|
if ((limitCondition != "") && (limit_parts.length == 2)) {
|
|
276
276
|
if (orderCondition == "") {
|
|
277
277
|
OINOLog.error("@oino-ts/db-mssql", "OINODbMsSql", "printSqlSelect", "LIMIT without ORDER BY is not supported in MS SQL Server")
|
|
278
|
-
throw new Error(OINO_ERROR_PREFIX + "LIMIT without ORDER BY is not supported in MS SQL Server")
|
|
278
|
+
throw new Error(OINO_ERROR_PREFIX + ": LIMIT without ORDER BY is not supported in MS SQL Server")
|
|
279
279
|
} else {
|
|
280
280
|
result += " OFFSET " + limit_parts[1] + " ROWS FETCH NEXT " + limit_parts[0] + " ROWS ONLY"
|
|
281
281
|
}
|