@wmfs/pg-delta-file 1.77.0 → 1.79.0
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/.circleci/config.yml +1 -1
- package/.releaserc.json +1 -1
- package/CHANGELOG.md +15 -0
- package/lib/Transformer.js +4 -2
- package/lib/generate-delta.js +1 -1
- package/lib/simple-csv-encoder.js +0 -1
- package/package.json +8 -8
package/.circleci/config.yml
CHANGED
@@ -10,7 +10,7 @@ jobs:
|
|
10
10
|
TZ: "Europe/London"
|
11
11
|
PG_CONNECTION_STRING: postgres://postgres:postgres@localhost:5432/circle_test
|
12
12
|
TIMEOUT: 15000
|
13
|
-
- image: cimg/postgres:15.
|
13
|
+
- image: cimg/postgres:15.2-postgis
|
14
14
|
environment:
|
15
15
|
POSTGRES_USER: postgres
|
16
16
|
POSTGRES_HOST_AUTH_METHOD: trust
|
package/.releaserc.json
CHANGED
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
# [1.79.0](https://github.com/wmfs/pg-delta-file/compare/v1.78.0...v1.79.0) (2024-08-27)
|
2
|
+
|
3
|
+
|
4
|
+
### Features
|
5
|
+
|
6
|
+
* allow optional progress frequency, default to 1000 ([#483](https://github.com/wmfs/pg-delta-file/issues/483)) ([20c890a](https://github.com/wmfs/pg-delta-file/commit/20c890a9720b625e9aa34f66e6775d240c540d65))
|
7
|
+
|
8
|
+
# [1.78.0](https://github.com/wmfs/pg-delta-file/compare/v1.77.0...v1.78.0) (2023-03-13)
|
9
|
+
|
10
|
+
|
11
|
+
### 🛠 Builds
|
12
|
+
|
13
|
+
* **deps-dev:** update dependency semantic-release to v20.1.1 ([896e36b](https://github.com/wmfs/pg-delta-file/commit/896e36b6a84e8fdae037016588f32d75ddc14236))
|
14
|
+
* **deps:** update dependency luxon to v3.3.0 ([c596236](https://github.com/wmfs/pg-delta-file/commit/c596236905b2d3f7848547051c94fec4350d48f9))
|
15
|
+
|
1
16
|
# [1.77.0](https://github.com/wmfs/pg-delta-file/compare/v1.76.0...v1.77.0) (2023-02-17)
|
2
17
|
|
3
18
|
|
package/lib/Transformer.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
const Transform = require('stream').Transform
|
2
2
|
const csvEncoder = require('./simple-csv-encoder')
|
3
3
|
const DateTime = require('luxon').DateTime
|
4
|
+
const DEFAULT_PROGRESS_FREQ = 1000
|
4
5
|
|
5
6
|
class Transformer extends Transform {
|
6
7
|
constructor (info, model, options, processingDeletes) {
|
@@ -28,6 +29,7 @@ class Transformer extends Transform {
|
|
28
29
|
this.filterFns = Array.isArray(filters) ? filters : [filters]
|
29
30
|
|
30
31
|
this.progressCallback = options.progressCallback
|
32
|
+
this.progressFrequency = options.progressFrequency || DEFAULT_PROGRESS_FREQ
|
31
33
|
|
32
34
|
const actionTransformer = !processingDeletes ? insertOrUpdateAction(options) : deleteAction(options)
|
33
35
|
|
@@ -82,9 +84,9 @@ class Transformer extends Transform {
|
|
82
84
|
progress () {
|
83
85
|
if (!this.progressCallback) return
|
84
86
|
|
85
|
-
// report every
|
87
|
+
// report every N rows
|
86
88
|
const c = this.modelInfo.totalCount
|
87
|
-
if (Math.trunc(c /
|
89
|
+
if (Math.trunc(c / this.progressFrequency) === (c / this.progressFrequency)) {
|
88
90
|
this.progressCallback(this.info, false)
|
89
91
|
}
|
90
92
|
}
|
package/lib/generate-delta.js
CHANGED
@@ -67,7 +67,7 @@ function extractModel (info, model, options, outStream) {
|
|
67
67
|
dbStream.on('end', () => { progressCallback(info, false); resolve() })
|
68
68
|
})
|
69
69
|
}
|
70
|
-
return options.client.run([{ sql
|
70
|
+
return options.client.run([{ sql, params: [options.since], action: csvTransform }])
|
71
71
|
} // extractModel
|
72
72
|
|
73
73
|
function tableName (namespace, model) {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@wmfs/pg-delta-file",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.79.0",
|
4
4
|
"description": "Outputs change-only-update CSV files (or “delta” files) that contain all the necessary actions required to re-synchronize rows in a cloned table.",
|
5
5
|
"author": "West Midlands Fire Service",
|
6
6
|
"homepage": "https://github.com/wmfs/pg-delta-file#readme",
|
@@ -22,22 +22,22 @@
|
|
22
22
|
"main": "./lib/index.js",
|
23
23
|
"dependencies": {
|
24
24
|
"lodash": "4.17.21",
|
25
|
-
"luxon": "3.
|
25
|
+
"luxon": "3.3.0",
|
26
26
|
"make-dir": "3.1.0",
|
27
27
|
"pg": "8.8.0",
|
28
28
|
"pg-query-stream": "4.2.4"
|
29
29
|
},
|
30
30
|
"devDependencies": {
|
31
|
-
"chai": "4.
|
31
|
+
"chai": "4.5.0",
|
32
32
|
"codecov": "3.8.3",
|
33
33
|
"conventional-changelog-metahub": "4.0.1",
|
34
34
|
"cz-conventional-changelog": "3.3.0",
|
35
35
|
"dirty-chai": "2.0.1",
|
36
|
-
"mocha": "10.
|
37
|
-
"nyc": "
|
38
|
-
"semantic-release": "
|
39
|
-
"standard": "17.
|
40
|
-
"@semantic-release/changelog": "6.0.
|
36
|
+
"mocha": "10.7.3",
|
37
|
+
"nyc": "17.0.0",
|
38
|
+
"semantic-release": "24.1.0",
|
39
|
+
"standard": "17.1.0",
|
40
|
+
"@semantic-release/changelog": "6.0.3",
|
41
41
|
"@semantic-release/git": "10.0.1",
|
42
42
|
"@wmfs/hl-pg-client": "1.31.0"
|
43
43
|
},
|