@live-change/db-server 0.9.98 → 0.9.100
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/Dockerfile +5 -2
- package/build-docker-and-upload.sh +5 -1
- package/lib/dbDao.js +4 -4
- package/package.json +14 -14
- package/prepare-builder.sh +13 -0
package/Dockerfile
CHANGED
|
@@ -11,13 +11,16 @@ RUN npm install -g node-lmdb
|
|
|
11
11
|
RUN npm install -g subleveldown
|
|
12
12
|
RUN npm install -g typescript
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
ARG VERSION=`echo "console.log(require('./package.json').version)" | node`
|
|
15
|
+
|
|
16
|
+
RUN npm install -g @live-change/db-client@$VERSION
|
|
15
17
|
|
|
16
18
|
# APP
|
|
17
19
|
RUN mkdir -p /app
|
|
18
20
|
WORKDIR /app
|
|
19
21
|
COPY package.json package.json
|
|
20
|
-
RUN --mount=type=secret,id=npmrc,target=/root/.npmrc yarn install --verbose --network-timeout 36000000
|
|
22
|
+
#RUN --mount=type=secret,id=npmrc,target=/root/.npmrc yarn install --verbose --network-timeout 36000000
|
|
23
|
+
RUN --mount=type=cache,id=npmrc,target=/app/node_modules; yarn install --frozen-lockfil --verbose --network-timeout 36000000
|
|
21
24
|
RUN cd node_modules/@live-change/db-admin/; npm run build
|
|
22
25
|
COPY /bin bin
|
|
23
26
|
COPY /lib lib
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
VERSION=`echo "console.log(require('./package.json').version)" | node`
|
|
3
3
|
PLATFORMS="linux/amd64,linux/arm64,linux/arm/v7"
|
|
4
|
+
export BUILDKIT_PROGRESS=plain
|
|
5
|
+
export DOCKER_BUILDKIT=1
|
|
4
6
|
#PLATFORMS="linux/amd64"
|
|
5
7
|
echo building docker image for version $VERSION
|
|
6
|
-
docker buildx use hybrid-
|
|
8
|
+
docker buildx use hybrid-builder
|
|
7
9
|
docker buildx build --debug \
|
|
10
|
+
--builder hybrid-builder \
|
|
11
|
+
--build-arg VERSION=$VERSION \
|
|
8
12
|
--platform $PLATFORMS \
|
|
9
13
|
-t livechange/db-server:$VERSION \
|
|
10
14
|
-t livechange/db-server:latest \
|
package/lib/dbDao.js
CHANGED
|
@@ -227,13 +227,13 @@ function localRequests(server, scriptContext) {
|
|
|
227
227
|
if(!log) throw new Error("logNotFound")
|
|
228
228
|
return log.putOld(object)
|
|
229
229
|
},
|
|
230
|
-
clearLog: (dbName, logName, before) => {
|
|
230
|
+
clearLog: (dbName, logName, before, maxCount) => {
|
|
231
231
|
if(dbName === 'system') throw new Error("system database is not writable")
|
|
232
232
|
const db = server.databases.get(dbName)
|
|
233
233
|
if(!db) throw new Error('databaseNotFound '+dbName)
|
|
234
234
|
const log = db.log(logName)
|
|
235
235
|
if(!log) throw new Error("logNotFound")
|
|
236
|
-
return log.clear(before)
|
|
236
|
+
return log.clear(before, maxCount || Infinity)
|
|
237
237
|
},
|
|
238
238
|
query: (dbName, code, params) => {
|
|
239
239
|
if(dbName === 'system') throw new Error("system database is not writable")
|
|
@@ -365,13 +365,13 @@ function remoteRequests(server) {
|
|
|
365
365
|
if(!log) throw new Error("logNotFound")
|
|
366
366
|
return server.masterDao.request(['database', 'putOldLog'], dbName, logName, object )
|
|
367
367
|
},
|
|
368
|
-
clearLog: (dbName, logName, before) => {
|
|
368
|
+
clearLog: (dbName, logName, before, maxCount) => {
|
|
369
369
|
if(dbName === 'system') throw new Error("system database is not writable")
|
|
370
370
|
const db = server.databases.get(dbName)
|
|
371
371
|
if(!db) throw new Error('databaseNotFound')
|
|
372
372
|
const log = db.log(logName)
|
|
373
373
|
if(!log) throw new Error("logNotFound")
|
|
374
|
-
return server.masterDao.request(['database', 'clearLog'], dbName, logName, before )
|
|
374
|
+
return server.masterDao.request(['database', 'clearLog'], dbName, logName, before, maxCount)
|
|
375
375
|
},
|
|
376
376
|
query: (dbName, code, params) => {
|
|
377
377
|
if(!dbName) throw new Error("databaseNameRequired")
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/db-server",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.100",
|
|
4
4
|
"description": "Database with observable data for live queries",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -32,18 +32,18 @@
|
|
|
32
32
|
"tape": "^5.7.4"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@live-change/dao": "^0.9.
|
|
36
|
-
"@live-change/dao-message": "^0.9.
|
|
37
|
-
"@live-change/dao-sockjs": "^0.9.
|
|
38
|
-
"@live-change/dao-websocket": "^0.9.
|
|
39
|
-
"@live-change/db": "^0.9.
|
|
40
|
-
"@live-change/db-admin": "^0.9.
|
|
41
|
-
"@live-change/db-client": "^0.9.
|
|
42
|
-
"@live-change/db-store-level": "^0.9.
|
|
43
|
-
"@live-change/db-store-lmdb": "^0.9.
|
|
44
|
-
"@live-change/db-store-observable-db": "^0.9.
|
|
45
|
-
"@live-change/db-store-rbtree": "^0.9.
|
|
46
|
-
"@live-change/server": "^0.9.
|
|
35
|
+
"@live-change/dao": "^0.9.100",
|
|
36
|
+
"@live-change/dao-message": "^0.9.100",
|
|
37
|
+
"@live-change/dao-sockjs": "^0.9.100",
|
|
38
|
+
"@live-change/dao-websocket": "^0.9.100",
|
|
39
|
+
"@live-change/db": "^0.9.100",
|
|
40
|
+
"@live-change/db-admin": "^0.9.100",
|
|
41
|
+
"@live-change/db-client": "^0.9.100",
|
|
42
|
+
"@live-change/db-store-level": "^0.9.100",
|
|
43
|
+
"@live-change/db-store-lmdb": "^0.9.100",
|
|
44
|
+
"@live-change/db-store-observable-db": "^0.9.100",
|
|
45
|
+
"@live-change/db-store-rbtree": "^0.9.100",
|
|
46
|
+
"@live-change/server": "^0.9.100",
|
|
47
47
|
"@live-change/sockjs": "0.4.1",
|
|
48
48
|
"@tailwindcss/vite": "^4.1.0",
|
|
49
49
|
"express": "^4.18.2",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"websocket": "^1.0.34",
|
|
54
54
|
"yargs": "^17.7.2"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "4e7ef4d160d217e1d82b8dc5fdf542a65f8a1834"
|
|
57
57
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
docker buildx rm hybrid-builder
|
|
3
|
+
docker builder prune -a
|
|
4
|
+
sudo systemctl restart docker
|
|
5
|
+
docker buildx create --name hybrid-builder --platform linux/amd64 --use
|
|
6
|
+
docker buildx create --name hybrid-builder \
|
|
7
|
+
--append \
|
|
8
|
+
--node armremote \
|
|
9
|
+
--platform linux/arm64,linux/arm \
|
|
10
|
+
tcp://100.64.0.2:2375
|
|
11
|
+
docker buildx use hybrid-builder
|
|
12
|
+
docker buildx ls
|
|
13
|
+
|