gtfs 4.7.1 → 4.7.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/CHANGELOG.md CHANGED
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [4.7.2] - 2024-03-05
9
+
10
+ ### Updated
11
+
12
+ - Show info about ignoreDuplicates option when primary key constraint issue happens
13
+ - Dependency updates
14
+
8
15
  ## [4.7.1] - 2024-02-18
9
16
 
10
17
  ### Updated
package/lib/import.js CHANGED
@@ -509,6 +509,13 @@ const importLines = (task, lines, model, totalLineCount) => {
509
509
  .join(', ')}) VALUES ${placeholders.join(',')}`,
510
510
  ).run(...values);
511
511
  } catch (error) {
512
+ if (error.code === 'SQLITE_CONSTRAINT_PRIMARYKEY') {
513
+ const primaryColumns = model.schema.filter((column) => column.primary);
514
+ task.warn(
515
+ `Duplicate values for primary key (${primaryColumns.map((column) => column.name).join(', ')}) found in ${model.filenameBase}.txt. Set the \`ignoreDuplicates\` option to true in config.json to ignore this error`,
516
+ );
517
+ }
518
+
512
519
  task.warn(
513
520
  `Check ${model.filenameBase}.txt for invalid data between lines ${
514
521
  totalLineCount - linesToImportCount
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gtfs",
3
- "version": "4.7.1",
3
+ "version": "4.7.2",
4
4
  "description": "Import GTFS transit data into SQLite and query routes, stops, times, fares and more",
5
5
  "keywords": [
6
6
  "transit",
@@ -75,9 +75,9 @@
75
75
  },
76
76
  "dependencies": {
77
77
  "@turf/helpers": "^6.5.0",
78
- "better-sqlite3": "^9.4.1",
79
- "csv-parse": "^5.5.3",
80
- "csv-stringify": "^6.4.5",
78
+ "better-sqlite3": "^9.4.3",
79
+ "csv-parse": "^5.5.5",
80
+ "csv-stringify": "^6.4.6",
81
81
  "gtfs-realtime-bindings": "^1.1.1",
82
82
  "lodash-es": "^4.17.21",
83
83
  "long": "^5.2.3",
@@ -93,7 +93,7 @@
93
93
  "tmp-promise": "^3.0.3",
94
94
  "untildify": "^5.0.0",
95
95
  "yargs": "^17.7.2",
96
- "yoctocolors": "^1.0.0"
96
+ "yoctocolors": "^2.0.0"
97
97
  },
98
98
  "devDependencies": {
99
99
  "husky": "^9.0.11",