w-orm-reladb 1.0.42 → 1.0.44
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/.github/workflows/ci-test.yml +3 -3
- package/.github/workflows/ci.yml +52 -0
- package/README.md +5 -6
- package/babel.config.js +4 -3
- package/dist/w-orm-reladb.umd.js +2 -2
- package/dist/w-orm-reladb.umd.js.map +1 -1
- package/docs/WOrmReladb.html +13 -13
- package/docs/WOrmReladb.mjs.html +28 -7
- package/docs/index.html +1 -1
- package/g-genModelsByTabs.mjs +4 -1
- package/g-mssql-concurrency.mjs +4 -1
- package/g-mssql-timerQuery.mjs +4 -1
- package/g-mssql-transaction-commit.mjs +4 -1
- package/g-mssql-transaction-rollback.mjs +4 -1
- package/g-mssql.mjs +4 -1
- package/g-sqlite-concurrency.mjs +4 -1
- package/g-sqlite-encryption-transaction-commit.mjs +5 -2
- package/g-sqlite-encryption-transaction-rollback.mjs +1 -1
- package/g-sqlite-encryption.mjs +5 -2
- package/g-sqlite-transaction-commit.mjs +5 -2
- package/g-sqlite-transaction-rollback.mjs +5 -2
- package/g-sqlite.mjs +5 -2
- package/package.json +8 -8
- package/script.txt +4 -4
- package/src/WOrmReladb.mjs +27 -6
- package/test/api-fixtures.mjs +48 -0
- package/test/api-mssql.test.mjs +212 -0
- package/test/api-sqlite.test.mjs +236 -0
- package/worm.sqlite +0 -0
- package/test/all.test.mjs +0 -10
|
@@ -9,12 +9,12 @@ jobs:
|
|
|
9
9
|
|
|
10
10
|
strategy:
|
|
11
11
|
matrix:
|
|
12
|
-
node-version: [
|
|
12
|
+
node-version: [24.x]
|
|
13
13
|
|
|
14
14
|
steps:
|
|
15
|
-
- uses: actions/checkout@
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
16
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
17
|
-
uses: actions/setup-node@
|
|
17
|
+
uses: actions/setup-node@v4
|
|
18
18
|
with:
|
|
19
19
|
node-version: ${{ matrix.node-version }}
|
|
20
20
|
- run: npm cache clean -f
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
name: test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [master]
|
|
6
|
+
pull_request:
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
|
|
13
|
+
services:
|
|
14
|
+
mssql:
|
|
15
|
+
image: mcr.microsoft.com/mssql/server:2022-latest
|
|
16
|
+
env:
|
|
17
|
+
ACCEPT_EULA: Y
|
|
18
|
+
MSSQL_SA_PASSWORD: Worm#Mssql2026
|
|
19
|
+
ports:
|
|
20
|
+
- 1433:1433
|
|
21
|
+
|
|
22
|
+
steps:
|
|
23
|
+
- uses: actions/checkout@v4
|
|
24
|
+
|
|
25
|
+
- uses: actions/setup-node@v4
|
|
26
|
+
with:
|
|
27
|
+
node-version: 20
|
|
28
|
+
cache: npm
|
|
29
|
+
|
|
30
|
+
- name: Install dependencies
|
|
31
|
+
run: npm ci
|
|
32
|
+
|
|
33
|
+
- name: Wait for MSSQL ready
|
|
34
|
+
run: |
|
|
35
|
+
for i in $(seq 1 30); do
|
|
36
|
+
if docker exec ${{ job.services.mssql.id }} /opt/mssql-tools18/bin/sqlcmd -C -S localhost -U sa -P 'Worm#Mssql2026' -b -Q "SELECT 1" >/dev/null 2>&1; then
|
|
37
|
+
echo "mssql ready"
|
|
38
|
+
exit 0
|
|
39
|
+
fi
|
|
40
|
+
sleep 3
|
|
41
|
+
done
|
|
42
|
+
echo "mssql not ready in time"
|
|
43
|
+
exit 1
|
|
44
|
+
|
|
45
|
+
- name: Provision worm database and login
|
|
46
|
+
run: |
|
|
47
|
+
docker exec ${{ job.services.mssql.id }} /opt/mssql-tools18/bin/sqlcmd -C -S localhost -U sa -P 'Worm#Mssql2026' -b -Q "CREATE DATABASE worm;"
|
|
48
|
+
docker exec ${{ job.services.mssql.id }} /opt/mssql-tools18/bin/sqlcmd -C -S localhost -U sa -P 'Worm#Mssql2026' -b -Q "CREATE LOGIN username WITH PASSWORD='password', CHECK_POLICY=OFF, CHECK_EXPIRATION=OFF, DEFAULT_DATABASE=worm;"
|
|
49
|
+
docker exec ${{ job.services.mssql.id }} /opt/mssql-tools18/bin/sqlcmd -C -S localhost -U sa -P 'Worm#Mssql2026' -b -d worm -Q "CREATE USER username FOR LOGIN username; ALTER ROLE db_owner ADD MEMBER username;"
|
|
50
|
+
|
|
51
|
+
- name: Run tests
|
|
52
|
+
run: npm test
|
package/README.md
CHANGED
|
@@ -4,7 +4,6 @@ An operator for relational database in nodejs.
|
|
|
4
4
|

|
|
5
5
|
[](https://npmjs.org/package/w-orm-reladb)
|
|
6
6
|
[](https://npmjs.org/package/w-orm-reladb)
|
|
7
|
-
[](https://github.com/yuda-lyu/w-orm-reladb)
|
|
8
7
|
[](https://npmjs.org/package/w-orm-reladb)
|
|
9
8
|
[](https://npmjs.org/package/w-orm-reladb)
|
|
10
9
|
[](https://www.jsdelivr.com/package/npm/w-orm-reladb)
|
|
@@ -20,8 +19,8 @@ To view documentation or get support, visit [docs](https://yuda-lyu.github.io/w-
|
|
|
20
19
|
>4. Install `@journeyapps/sqlcipher` second, use command to install: `npm i @journeyapps/sqlcipher`.
|
|
21
20
|
|
|
22
21
|
## Installation
|
|
22
|
+
|
|
23
23
|
### Using npm(ES6 module):
|
|
24
|
-
> **Note:** `w-orm-reladb` is mainly dependent on `sequelize`, `mssql`, `sqlite3` and `w-auto-sequelize`.
|
|
25
24
|
|
|
26
25
|
> **Note:** `@journeyapps/sqlcipher` is not compiled into the *.umd file by default, and it is not tied to the dependents for general use in package.json.
|
|
27
26
|
|
|
@@ -735,7 +734,7 @@ async function test() {
|
|
|
735
734
|
// })
|
|
736
735
|
|
|
737
736
|
|
|
738
|
-
//createStorage, create table for
|
|
737
|
+
//createStorage, create table for sqlite
|
|
739
738
|
await w.createStorage()
|
|
740
739
|
console.log('createStorage')
|
|
741
740
|
|
|
@@ -931,7 +930,7 @@ async function testCommit() {
|
|
|
931
930
|
let w = wo(opt)
|
|
932
931
|
|
|
933
932
|
|
|
934
|
-
//createStorage, create table for
|
|
933
|
+
//createStorage, create table for sqlite
|
|
935
934
|
await w.createStorage()
|
|
936
935
|
console.log('createStorage')
|
|
937
936
|
|
|
@@ -1155,7 +1154,7 @@ async function testRollback() {
|
|
|
1155
1154
|
let w = wo(opt)
|
|
1156
1155
|
|
|
1157
1156
|
|
|
1158
|
-
//createStorage, create table for
|
|
1157
|
+
//createStorage, create table for sqlite
|
|
1159
1158
|
await w.createStorage()
|
|
1160
1159
|
console.log('createStorage')
|
|
1161
1160
|
|
|
@@ -1393,7 +1392,7 @@ async function test() {
|
|
|
1393
1392
|
// })
|
|
1394
1393
|
|
|
1395
1394
|
|
|
1396
|
-
//createStorage, create table for
|
|
1395
|
+
//createStorage, create table for sqlite
|
|
1397
1396
|
await w.createStorage()
|
|
1398
1397
|
console.log('createStorage')
|
|
1399
1398
|
|
package/babel.config.js
CHANGED
|
@@ -7,9 +7,10 @@ module.exports = {
|
|
|
7
7
|
],
|
|
8
8
|
'plugins': [
|
|
9
9
|
'@babel/plugin-transform-runtime',
|
|
10
|
-
'@babel/plugin-syntax-import-assertions',
|
|
11
10
|
'@babel/plugin-proposal-export-default-from',
|
|
12
|
-
'@babel/plugin-
|
|
13
|
-
'@babel/plugin-proposal-
|
|
11
|
+
// '@babel/plugin-syntax-import-assertions', //已被棄用
|
|
12
|
+
// '@babel/plugin-proposal-nullish-coalescing-operator', //browser與nodejs已支援
|
|
13
|
+
// '@babel/plugin-proposal-object-rest-spread', //browser與nodejs已支援
|
|
14
|
+
// '@babel/plugin-proposal-optional-chaining', //browser與nodejs已支援
|
|
14
15
|
]
|
|
15
16
|
}
|