db-modeling-markdown 2.0.1 → 2.1.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.
Files changed (118) hide show
  1. package/README.md +168 -164
  2. package/dist/dialects/core/dbImportProvider.d.ts +5 -5
  3. package/dist/dialects/core/dbImportProvider.js +6 -6
  4. package/dist/dialects/core/dbProvider.d.ts +34 -34
  5. package/dist/dialects/core/dbProvider.js +119 -119
  6. package/dist/dialects/core/dbProvider.js.map +1 -1
  7. package/dist/dialects/core/dbUtils.d.ts +35 -35
  8. package/dist/dialects/core/dbUtils.js +157 -158
  9. package/dist/dialects/core/dbUtils.js.map +1 -1
  10. package/dist/dialects/core/providerFactory.d.ts +7 -7
  11. package/dist/dialects/core/providerFactory.js +63 -63
  12. package/dist/dialects/core/providerFactory.js.map +1 -1
  13. package/dist/dialects/db2/db2Provider.d.ts +19 -19
  14. package/dist/dialects/db2/db2Provider.js +185 -186
  15. package/dist/dialects/db2/db2Provider.js.map +1 -1
  16. package/dist/dialects/mariadb/mariaDbImportProvider.d.ts +19 -19
  17. package/dist/dialects/mariadb/mariaDbImportProvider.js +260 -253
  18. package/dist/dialects/mariadb/mariaDbImportProvider.js.map +1 -1
  19. package/dist/dialects/mariadb/mariaDbProvider.d.ts +18 -18
  20. package/dist/dialects/mariadb/mariaDbProvider.js +152 -153
  21. package/dist/dialects/mariadb/mariaDbProvider.js.map +1 -1
  22. package/dist/dialects/mariadb/mariaDbUtil.d.ts +6 -6
  23. package/dist/dialects/mariadb/mariaDbUtil.js +22 -22
  24. package/dist/dialects/mariadb/mariaDbUtil.js.map +1 -1
  25. package/dist/dialects/mssql/msSqlProvider.d.ts +21 -21
  26. package/dist/dialects/mssql/msSqlProvider.js +264 -265
  27. package/dist/dialects/mssql/msSqlProvider.js.map +1 -1
  28. package/dist/dialects/mysql/mySqlImportProvider.d.ts +3 -3
  29. package/dist/dialects/mysql/mySqlImportProvider.js +7 -7
  30. package/dist/dialects/mysql/mySqlProvider.d.ts +3 -3
  31. package/dist/dialects/mysql/mySqlProvider.js +7 -7
  32. package/dist/dialects/oracle/oracleProvider.d.ts +35 -35
  33. package/dist/dialects/oracle/oracleProvider.js +327 -327
  34. package/dist/dialects/oracle/oracleProvider.js.map +1 -1
  35. package/dist/dialects/postgresql/postgreSqlProvider.d.ts +19 -19
  36. package/dist/dialects/postgresql/postgreSqlProvider.js +172 -173
  37. package/dist/dialects/postgresql/postgreSqlProvider.js.map +1 -1
  38. package/dist/dialects/sqlite/sqliteSqlProvider.d.ts +23 -23
  39. package/dist/dialects/sqlite/sqliteSqlProvider.js +147 -148
  40. package/dist/dialects/sqlite/sqliteSqlProvider.js.map +1 -1
  41. package/dist/index.d.ts +10 -10
  42. package/dist/index.js +9 -9
  43. package/dist/lib/code-flow/codeFlow.d.ts +37 -37
  44. package/dist/lib/code-flow/codeFlow.js +61 -61
  45. package/dist/lib/markdown-object/markdownModel.d.ts +14 -14
  46. package/dist/lib/markdown-object/markdownModel.js +12 -12
  47. package/dist/lib/markdown-object/markdownModel.js.map +1 -1
  48. package/dist/lib/markdown-object/markdownReader.d.ts +39 -39
  49. package/dist/lib/markdown-object/markdownReader.js +261 -258
  50. package/dist/lib/markdown-object/markdownReader.js.map +1 -1
  51. package/dist/lib/markdown-object/markdownWriter.d.ts +36 -36
  52. package/dist/lib/markdown-object/markdownWriter.js +224 -223
  53. package/dist/lib/markdown-object/markdownWriter.js.map +1 -1
  54. package/dist/lib/markdown-object/readerContext.d.ts +12 -12
  55. package/dist/lib/markdown-object/readerContext.js +48 -48
  56. package/dist/lib/markdown-object/readerContext.js.map +1 -1
  57. package/dist/lib/utils/fileHelper.d.ts +14 -15
  58. package/dist/lib/utils/fileHelper.js +58 -57
  59. package/dist/lib/utils/fileHelper.js.map +1 -1
  60. package/dist/lib/utils/logger.d.ts +9 -9
  61. package/dist/lib/utils/logger.js +60 -60
  62. package/dist/lib/utils/logger.js.map +1 -1
  63. package/dist/lib/utils/markdownParser.d.ts +22 -22
  64. package/dist/lib/utils/markdownParser.js +99 -95
  65. package/dist/lib/utils/markdownParser.js.map +1 -1
  66. package/dist/lib/utils/sqlHelper.d.ts +3 -3
  67. package/dist/lib/utils/sqlHelper.js +23 -23
  68. package/dist/lib/utils/sqlHelper.js.map +1 -1
  69. package/dist/lib/utils/systemHelper.d.ts +2 -2
  70. package/dist/lib/utils/systemHelper.js +6 -6
  71. package/dist/lib/utils/textFileReader.d.ts +25 -25
  72. package/dist/lib/utils/textFileReader.js +57 -57
  73. package/dist/lib/utils/textFileReader.js.map +1 -1
  74. package/dist/lib/utils/textHelper.d.ts +21 -21
  75. package/dist/lib/utils/textHelper.js +75 -71
  76. package/dist/lib/utils/textHelper.js.map +1 -1
  77. package/dist/models/databaseTypes.d.ts +33 -33
  78. package/dist/models/databaseTypes.js +37 -37
  79. package/dist/models/databaseTypes.js.map +1 -1
  80. package/dist/models/dbColumn.d.ts +43 -43
  81. package/dist/models/dbColumn.js +2 -2
  82. package/dist/models/dbDiffModel.d.ts +43 -43
  83. package/dist/models/dbDiffModel.js +2 -2
  84. package/dist/models/dbForeignKey.d.ts +33 -33
  85. package/dist/models/dbForeignKey.js +2 -2
  86. package/dist/models/dbIndex.d.ts +28 -28
  87. package/dist/models/dbIndex.js +2 -2
  88. package/dist/models/dbIndexType.d.ts +8 -8
  89. package/dist/models/dbIndexType.js +12 -12
  90. package/dist/models/dbIndexType.js.map +1 -1
  91. package/dist/models/dbModel.d.ts +10 -10
  92. package/dist/models/dbModel.js +2 -2
  93. package/dist/models/dbPrimaryKey.d.ts +16 -16
  94. package/dist/models/dbPrimaryKey.js +2 -2
  95. package/dist/models/dbTable.d.ts +49 -49
  96. package/dist/models/dbTable.js +2 -2
  97. package/dist/models/dbTableMarkdown.d.ts +35 -34
  98. package/dist/models/dbTableMarkdown.js +2 -2
  99. package/dist/resources/mariadb/procAppUpgradeDB.sql +164 -0
  100. package/dist/resources/mariadb/sql-create-table-fk.njk +10 -0
  101. package/dist/resources/mariadb/sql-create-table.njk +12 -0
  102. package/dist/resources/mariadb/sql-create-tables.njk +9 -0
  103. package/dist/resources/mariadb/sql-drop-tables.njk +10 -0
  104. package/dist/resources/mariadb/sql-drop-then-create-tables.njk +4 -0
  105. package/dist/resources/mariadb/sql-upgrade-new-table.njk +15 -0
  106. package/dist/resources/mariadb/sql-upgrade-table-fk.njk +10 -0
  107. package/dist/resources/mariadb/sql-upgrade-table.njk +41 -0
  108. package/dist/resources/mariadb/sql-upgrade-tables.njk +19 -0
  109. package/dist/services/dbOptions.d.ts +35 -35
  110. package/dist/services/dbOptions.js +17 -17
  111. package/dist/services/dbmOptions.d.ts +28 -28
  112. package/dist/services/dbmOptions.js +34 -34
  113. package/dist/services/dbmService.d.ts +87 -87
  114. package/dist/services/dbmService.js +244 -246
  115. package/dist/services/dbmService.js.map +1 -1
  116. package/package.json +29 -34
  117. package/CHANGELOG.md +0 -81
  118. package/CONTRIBUTING.md +0 -82
package/CHANGELOG.md DELETED
@@ -1,81 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## [Unreleased]
9
-
10
- ## [2.0.1] - 2022-12-08
11
-
12
- ### Changes
13
-
14
- - [Feature]: [mariadb/mysql] provice method `fromDatabase`
15
- Generate database model markdow files from a specific database.
16
- - [Feature]: [mariadb/mysql] provice method `toUpgradeSql`
17
- Generate a SQL file with upgrade scripts.
18
- - [Feature]: provide more readable format for markdown files
19
- - [Feature]: [mariadb/mysql] provice method `genIndexFile`
20
- Generate a `index.md` for all tables
21
-
22
- ## [1.0.6] - 2021-11-19
23
-
24
- ### Fix
25
-
26
- - [Defect]: error when there is an empty definition file
27
-
28
- ## [1.0.5] - 2021-11-19
29
-
30
- ### Fix
31
-
32
- - [Defect]: bad package
33
-
34
- ## [1.0.4] - 2021-11-19
35
-
36
- ### Fix
37
-
38
- - [Defect]: bad package
39
-
40
- ## [1.0.3] - 2021-11-17
41
-
42
- ### Fix
43
-
44
- - [Defect]: do not export file when file name is not provided.
45
-
46
- ## [1.0.2] - 2020-02-23
47
-
48
- ### Changes
49
-
50
- - [Feature]: provice method toMarkdown
51
-
52
- ### Fixed
53
-
54
- - [Defect]: some document issues.
55
-
56
- ## [1.0.1] - 2020-02-22
57
-
58
- ### Fixed
59
-
60
- - No declaration files.
61
-
62
- ## [1.0.0] - 2020-02-22
63
-
64
- ### Added
65
-
66
- - Support Databases:
67
-
68
- - DB2
69
- - MariaDB
70
- - MS SQL Server
71
- - MySQL
72
- - Oracle Database
73
- - PostgreSQL
74
- - SQLite
75
-
76
- - Support generate SQL scripts of create tables.
77
- - Support generate SQL scripts of create tables if not exists.
78
- - Support generate SQL scripts of drop then create tables.
79
- - Support generate SQL scripts of drop tables.
80
- - Support generate a json file of the database model.
81
- - Support generate an model object of the database model.
package/CONTRIBUTING.md DELETED
@@ -1,82 +0,0 @@
1
- # Contributing to db-modeling-markdown
2
-
3
- ## Prepare Development Environment
4
-
5
- ```sh
6
- npm add --global yarn
7
- npm add --global prettier typescript ts-node
8
- yarn
9
- yarn prepare
10
- ```
11
-
12
- ## Publish steps
13
-
14
- - change the package version `package.json`
15
- - change `CHANGELOG.md` for new features or fixes.
16
- - update sample scripts `examples\generator.ts`
17
- - update `README.md`
18
- - version
19
- - sample typescrit
20
- - features and so on
21
- - build: run `yarn build`
22
- - check the package
23
- - edit `~/npmrc`, comment out the mirrow repositories
24
- - if need, `npm adduser` to add your npm user
25
- - publish: `npm publish --access public`
26
- - document: update gitee pages
27
-
28
- ## Test
29
-
30
- - test all
31
-
32
- ```sh
33
- yarn test
34
- ```
35
-
36
- - test a specific test file
37
-
38
- ```sh
39
- yarn test filename.test.ts
40
- ```
41
-
42
- ## Tips
43
-
44
- - we can use the variable `OverwriteExpected` to overwrite expected files
45
-
46
- [dbmService.test.ts](tests\services\dbmService.test.ts)
47
-
48
- ```ts
49
- // used to overwrite expected data
50
- const OverwriteExpected = false
51
- ```
52
-
53
- ## Command
54
-
55
- - Generate table markdown files for all databases
56
-
57
- ```typescript
58
- // run tests\data\generateMarkdown.ts
59
- ```
60
-
61
- - husky: project initialization
62
-
63
- ```sh
64
- # husky init (for project initialization)
65
- # npx husky-init
66
- ```
67
-
68
- - husky: pre-commit command
69
- [pre-commit.sh](.husky/pre-commit)
70
-
71
- ## Guidelings
72
-
73
- ### Coding Conventions
74
-
75
- - Use `tab` rather than `space`
76
- - using `.test.{ts, js}` extension for unit test files
77
- - folder and file name: `camel`
78
- - class name: `Pascal`
79
- - max line width: `120`
80
- - type scripts
81
- - Semicolons: `true`
82
- - Quotes: `single quoted`