@wmfs/pg-delta-file 1.78.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.
@@ -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.1-postgis
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
@@ -12,7 +12,7 @@
12
12
  "@semantic-release/git"
13
13
  ],
14
14
  "generateNotes": {
15
- "preset": "metahub"
15
+ "preset": "angular"
16
16
  },
17
17
  "prepare": [
18
18
  {
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
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
+
1
8
  # [1.78.0](https://github.com/wmfs/pg-delta-file/compare/v1.77.0...v1.78.0) (2023-03-13)
2
9
 
3
10
 
@@ -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 1000 rows
87
+ // report every N rows
86
88
  const c = this.modelInfo.totalCount
87
- if (Math.trunc(c / 1000) === (c / 1000)) {
89
+ if (Math.trunc(c / this.progressFrequency) === (c / this.progressFrequency)) {
88
90
  this.progressCallback(this.info, false)
89
91
  }
90
92
  }
@@ -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: sql, params: [options.since], action: csvTransform }])
70
+ return options.client.run([{ sql, params: [options.since], action: csvTransform }])
71
71
  } // extractModel
72
72
 
73
73
  function tableName (namespace, model) {
@@ -1,4 +1,3 @@
1
-
2
1
  const _ = require('lodash')
3
2
  module.exports = function (csvParts) {
4
3
  const quoted = []
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wmfs/pg-delta-file",
3
- "version": "1.78.0",
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",
@@ -28,16 +28,16 @@
28
28
  "pg-query-stream": "4.2.4"
29
29
  },
30
30
  "devDependencies": {
31
- "chai": "4.3.7",
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.2.0",
37
- "nyc": "15.1.0",
38
- "semantic-release": "20.1.1",
39
- "standard": "17.0.0",
40
- "@semantic-release/changelog": "6.0.2",
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
  },