@pgpmjs/export 0.2.0 → 0.2.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.
@@ -1,6 +1,6 @@
1
1
  import { mkdirSync, rmSync } from 'fs';
2
2
  import { sync as glob } from 'glob';
3
- import { toSnakeCase } from 'komoji';
3
+ import { toSnakeCase } from 'inflekt';
4
4
  import path from 'path';
5
5
  import { PgpmPackage, getMissingInstallableModules, parseAuthor } from '@pgpmjs/core';
6
6
  // =============================================================================
@@ -13,7 +13,7 @@
13
13
  * db_migrate.sql_actions -> sqlActions
14
14
  * column database_id -> databaseId
15
15
  */
16
- import { toCamelCase, toPascalCase, distinctPluralize, singularizeLast, underscore } from 'inflekt';
16
+ import { toCamelCase, toPascalCase, toSnakeCase, distinctPluralize, singularizeLast } from 'inflekt';
17
17
  /**
18
18
  * Get the GraphQL query field name for a given Postgres table name.
19
19
  * Mirrors the PostGraphile InflektPlugin's allRowsConnection inflector:
@@ -32,7 +32,7 @@ export const getGraphQLQueryName = (pgTableName) => {
32
32
  export const graphqlRowToPostgresRow = (row) => {
33
33
  const result = {};
34
34
  for (const [key, value] of Object.entries(row)) {
35
- result[underscore(key)] = value;
35
+ result[toSnakeCase(key)] = value;
36
36
  }
37
37
  return result;
38
38
  };
package/export-utils.js CHANGED
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.normalizeOutdir = exports.preparePackage = exports.makeReplacer = exports.installMissingModules = exports.detectMissingModules = exports.META_TABLE_CONFIG = exports.META_TABLE_ORDER = exports.META_COMMON_FOOTER = exports.META_COMMON_HEADER = exports.SERVICE_REQUIRED_EXTENSIONS = exports.DB_REQUIRED_EXTENSIONS = void 0;
7
7
  const fs_1 = require("fs");
8
8
  const glob_1 = require("glob");
9
- const komoji_1 = require("komoji");
9
+ const inflekt_1 = require("inflekt");
10
10
  const path_1 = __importDefault(require("path"));
11
11
  const core_1 = require("@pgpmjs/core");
12
12
  // =============================================================================
@@ -1082,7 +1082,7 @@ const makeReplacer = ({ schemas, name, schemaPrefix }) => {
1082
1082
  const prefix = schemaPrefix || name;
1083
1083
  const schemaReplacers = schemas.map((schema) => [
1084
1084
  schema.schema_name,
1085
- (0, komoji_1.toSnakeCase)(`${prefix}_${schema.name}`)
1085
+ (0, inflekt_1.toSnakeCase)(`${prefix}_${schema.name}`)
1086
1086
  ]);
1087
1087
  const replace = [...schemaReplacers, replacements].map(([from, to]) => [new RegExp(from, 'g'), to]);
1088
1088
  const replacer = (str, n = 0) => {
package/graphql-naming.js CHANGED
@@ -36,7 +36,7 @@ exports.getGraphQLQueryName = getGraphQLQueryName;
36
36
  const graphqlRowToPostgresRow = (row) => {
37
37
  const result = {};
38
38
  for (const [key, value] of Object.entries(row)) {
39
- result[(0, inflekt_1.underscore)(key)] = value;
39
+ result[(0, inflekt_1.toSnakeCase)(key)] = value;
40
40
  }
41
41
  return result;
42
42
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pgpmjs/export",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "author": "Constructive <developers@constructive.io>",
5
5
  "description": "PGPM export tools for SQL and GraphQL database migration extraction",
6
6
  "main": "index.js",
@@ -41,20 +41,19 @@
41
41
  "@pgsql/types": "^17.6.2",
42
42
  "@types/pg": "^8.18.0",
43
43
  "makage": "^0.1.12",
44
- "pgsql-test": "^4.7.0"
44
+ "pgsql-test": "^4.7.2"
45
45
  },
46
46
  "dependencies": {
47
- "@pgpmjs/core": "^6.10.0",
48
- "@pgpmjs/migrate-client": "^0.3.0",
49
- "@pgpmjs/types": "^2.20.0",
50
- "csv-to-pg": "^3.11.0",
47
+ "@pgpmjs/core": "^6.10.2",
48
+ "@pgpmjs/migrate-client": "^0.3.1",
49
+ "@pgpmjs/types": "^2.20.1",
50
+ "csv-to-pg": "^3.11.1",
51
51
  "glob": "^13.0.6",
52
- "inflekt": "^0.5.1",
52
+ "inflekt": "^0.6.0",
53
53
  "inquirerer": "^4.7.0",
54
- "komoji": "^0.8.1",
55
54
  "pg": "^8.20.0",
56
- "pg-cache": "^3.4.0",
57
- "pg-env": "^1.8.0"
55
+ "pg-cache": "^3.4.1",
56
+ "pg-env": "^1.8.1"
58
57
  },
59
- "gitHead": "b8ed57a447cd71b93094edf362e72b94801e5f3a"
58
+ "gitHead": "93deca687ce109bf90d2a0a73ea6b05b22724160"
60
59
  }