@dbml/cli 8.0.0-alpha.9 → 8.0.0-prerelease.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 (94) hide show
  1. package/__tests__/db2dbml/mssql/dbml-error.log +110 -0
  2. package/__tests__/db2dbml/mysql/dbml-error.log +143 -0
  3. package/__tests__/db2dbml/oracle/dbml-error.log +154 -0
  4. package/__tests__/db2dbml/postgres/dbml-error.log +77 -0
  5. package/__tests__/dbml2sql/filename --mysql --out-file/out-files/schema.sql +1 -1
  6. package/__tests__/dbml2sql/filename --oracle --out-file/out-files/schema.sql +1 -1
  7. package/__tests__/dbml2sql/filename --out-file/out-files/schema.sql +1 -1
  8. package/__tests__/dbml2sql/filename --postgres --out-file/out-files/schema.sql +1 -1
  9. package/__tests__/dbml2sql/filenames --mysql --out-file/out-files/schema.sql +1 -1
  10. package/__tests__/dbml2sql/filenames --oracle --out-file/out-files/schema.sql +1 -1
  11. package/__tests__/dbml2sql/filenames --out-file/out-files/schema.sql +1 -1
  12. package/__tests__/dbml2sql/filenames --postgres --out-file/out-files/schema.sql +1 -1
  13. package/__tests__/dbml2sql/multifile aliased import stdout/dbml-error.log +0 -0
  14. package/__tests__/dbml2sql/multifile aliased import stdout/in-files/auth.dbml +4 -0
  15. package/__tests__/dbml2sql/multifile aliased import stdout/in-files/main.dbml +6 -0
  16. package/__tests__/dbml2sql/multifile aliased import stdout/options.json +3 -0
  17. package/__tests__/dbml2sql/multifile aliased import stdout/stdout.txt +12 -0
  18. package/__tests__/dbml2sql/multifile circular import stdout/dbml-error.log +0 -0
  19. package/__tests__/dbml2sql/multifile circular import stdout/in-files/a.dbml +6 -0
  20. package/__tests__/dbml2sql/multifile circular import stdout/in-files/b.dbml +6 -0
  21. package/__tests__/dbml2sql/multifile circular import stdout/options.json +3 -0
  22. package/__tests__/dbml2sql/multifile circular import stdout/stdout.txt +14 -0
  23. package/__tests__/dbml2sql/multifile error entry-syntax-error/dbml-error.log +97 -0
  24. package/__tests__/dbml2sql/multifile error entry-syntax-error/in-files/lib.dbml +4 -0
  25. package/__tests__/dbml2sql/multifile error entry-syntax-error/in-files/main.dbml +6 -0
  26. package/__tests__/dbml2sql/multifile error entry-syntax-error/options.json +3 -0
  27. package/__tests__/dbml2sql/multifile error entry-syntax-error/stdout.txt +5 -0
  28. package/__tests__/dbml2sql/multifile error import-not-found/dbml-error.log +7182 -0
  29. package/__tests__/dbml2sql/multifile error import-not-found/in-files/main.dbml +5 -0
  30. package/__tests__/dbml2sql/multifile error import-not-found/options.json +3 -0
  31. package/__tests__/dbml2sql/multifile error import-not-found/stdout.txt +4 -0
  32. package/__tests__/dbml2sql/multifile error imported-syntax-error/dbml-error.log +28 -0
  33. package/__tests__/dbml2sql/multifile error imported-syntax-error/in-files/broken.dbml +4 -0
  34. package/__tests__/dbml2sql/multifile error imported-syntax-error/in-files/main.dbml +6 -0
  35. package/__tests__/dbml2sql/multifile error imported-syntax-error/options.json +3 -0
  36. package/__tests__/dbml2sql/multifile error imported-syntax-error/stdout.txt +5 -0
  37. package/__tests__/dbml2sql/multifile error transitive-use-not-visible/dbml-error.log +28 -0
  38. package/__tests__/dbml2sql/multifile error transitive-use-not-visible/in-files/base.dbml +6 -0
  39. package/__tests__/dbml2sql/multifile error transitive-use-not-visible/in-files/main.dbml +3 -0
  40. package/__tests__/dbml2sql/multifile error transitive-use-not-visible/in-files/types.dbml +4 -0
  41. package/__tests__/dbml2sql/multifile error transitive-use-not-visible/options.json +3 -0
  42. package/__tests__/dbml2sql/multifile error transitive-use-not-visible/stdout.txt +4 -0
  43. package/__tests__/dbml2sql/multifile records pulling stdout/dbml-error.log +0 -0
  44. package/__tests__/dbml2sql/multifile records pulling stdout/in-files/base.dbml +9 -0
  45. package/__tests__/dbml2sql/multifile records pulling stdout/in-files/main.dbml +6 -0
  46. package/__tests__/dbml2sql/multifile records pulling stdout/options.json +3 -0
  47. package/__tests__/dbml2sql/multifile records pulling stdout/stdout.txt +23 -0
  48. package/__tests__/dbml2sql/multifile refs across files stdout/dbml-error.log +0 -0
  49. package/__tests__/dbml2sql/multifile refs across files stdout/in-files/main.dbml +2 -0
  50. package/__tests__/dbml2sql/multifile refs across files stdout/in-files/orders.dbml +8 -0
  51. package/__tests__/dbml2sql/multifile refs across files stdout/in-files/users.dbml +4 -0
  52. package/__tests__/dbml2sql/multifile refs across files stdout/options.json +3 -0
  53. package/__tests__/dbml2sql/multifile refs across files stdout/stdout.txt +12 -0
  54. package/__tests__/dbml2sql/multifile schema pulling stdout/dbml-error.log +0 -0
  55. package/__tests__/dbml2sql/multifile schema pulling stdout/in-files/auth.dbml +9 -0
  56. package/__tests__/dbml2sql/multifile schema pulling stdout/in-files/main.dbml +3 -0
  57. package/__tests__/dbml2sql/multifile schema pulling stdout/options.json +3 -0
  58. package/__tests__/dbml2sql/multifile schema pulling stdout/stdout.txt +14 -0
  59. package/__tests__/dbml2sql/multifile tablegroup pulling stdout/dbml-error.log +0 -0
  60. package/__tests__/dbml2sql/multifile tablegroup pulling stdout/in-files/base.dbml +14 -0
  61. package/__tests__/dbml2sql/multifile tablegroup pulling stdout/in-files/main.dbml +1 -0
  62. package/__tests__/dbml2sql/multifile tablegroup pulling stdout/options.json +3 -0
  63. package/__tests__/dbml2sql/multifile tablegroup pulling stdout/stdout.txt +12 -0
  64. package/__tests__/dbml2sql/multifile transitive reuse stdout/dbml-error.log +0 -0
  65. package/__tests__/dbml2sql/multifile transitive reuse stdout/in-files/base.dbml +6 -0
  66. package/__tests__/dbml2sql/multifile transitive reuse stdout/in-files/main.dbml +7 -0
  67. package/__tests__/dbml2sql/multifile transitive reuse stdout/in-files/types.dbml +4 -0
  68. package/__tests__/dbml2sql/multifile transitive reuse stdout/options.json +3 -0
  69. package/__tests__/dbml2sql/multifile transitive reuse stdout/stdout.txt +20 -0
  70. package/__tests__/dbml2sql/multiple_schema_mssql/out-files/multiple_schema.out.sql +1 -1
  71. package/__tests__/dbml2sql/multiple_schema_mysql/out-files/multiple_schema.out.sql +1 -1
  72. package/__tests__/dbml2sql/multiple_schema_oracle/out-files/multiple_schema.out.sql +1 -1
  73. package/__tests__/dbml2sql/multiple_schema_pg/out-files/multiple_schema.out.sql +1 -1
  74. package/__tests__/dbml2sql/single file stdout/dbml-error.log +0 -0
  75. package/__tests__/dbml2sql/single file stdout/in-files/schema.dbml +11 -0
  76. package/__tests__/dbml2sql/single file stdout/options.json +3 -0
  77. package/__tests__/dbml2sql/single file stdout/stdout.txt +14 -0
  78. package/__tests__/dbml2sql/syntax-error/dbml-error.log +116 -0
  79. package/__tests__/sql2dbml/custom-error-alter-table-column-not-found --oracle/dbml-error.log +44 -0
  80. package/__tests__/sql2dbml/custom-error-alter-table-table-not-found --oracle/dbml-error.log +44 -0
  81. package/__tests__/sql2dbml/custom-error-column-comment-column-not-found --oracle/dbml-error.log +44 -0
  82. package/__tests__/sql2dbml/custom-error-column-comment-table-not-found --oracle/dbml-error.log +44 -0
  83. package/__tests__/sql2dbml/custom-error-create-index-table-not-found --oracle/dbml-error.log +44 -0
  84. package/__tests__/sql2dbml/custom-error-table-comment-table-not-found --oracle/dbml-error.log +44 -0
  85. package/__tests__/sql2dbml/syntax-error/dbml-error.log +44 -0
  86. package/__tests__/sql2dbml/syntax-error-duplicate-endpoints --mssql/dbml-error.log +44 -0
  87. package/__tests__/sql2dbml/syntax-error-duplicate-endpoints --mysql/dbml-error.log +44 -0
  88. package/lib/index.js +44 -91
  89. package/package.json +5 -5
  90. package/src/NodeProjectLayout.ts +31 -89
  91. package/src/cli/connector.ts +5 -2
  92. package/src/cli/export.ts +19 -18
  93. package/src/cli/import.ts +7 -3
  94. package/src/helpers/logger.ts +4 -23
@@ -0,0 +1,6 @@
1
+ use { table B } from './b.dbml'
2
+
3
+ Table A {
4
+ id int [pk]
5
+ b_id int [ref: > B.id]
6
+ }
@@ -0,0 +1,6 @@
1
+ use { table A } from './a.dbml'
2
+
3
+ Table B {
4
+ id int [pk]
5
+ a_id int [ref: > A.id]
6
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "args": ["./in-files/a.dbml"]
3
+ }
@@ -0,0 +1,14 @@
1
+ CREATE TABLE "A" (
2
+ "id" int PRIMARY KEY,
3
+ "b_id" int
4
+ );
5
+
6
+ CREATE TABLE "B" (
7
+ "id" int PRIMARY KEY,
8
+ "a_id" int
9
+ );
10
+
11
+ ALTER TABLE "A" ADD FOREIGN KEY ("b_id") REFERENCES "B" ("id") DEFERRABLE INITIALLY IMMEDIATE;
12
+
13
+ ALTER TABLE "B" ADD FOREIGN KEY ("a_id") REFERENCES "A" ("id") DEFERRABLE INITIALLY IMMEDIATE;
14
+
@@ -0,0 +1,97 @@
1
+ 2026-05-14T08:24:12.026Z
2
+
3
+ ./in-files/main.dbml(5,15): Expect an identifier
4
+ ./in-files/main.dbml(4,11): Unknown column setting 'pk user_id int'
5
+
6
+ 2026-05-14T08:24:50.143Z
7
+
8
+ ./in-files/main.dbml(5,15): Expect an identifier
9
+ ./in-files/main.dbml(4,11): Unknown column setting 'pk user_id int'
10
+
11
+ 2026-05-14T08:25:30.846Z
12
+
13
+ ./in-files/main.dbml(5,15): Expect an identifier
14
+ ./in-files/main.dbml(4,11): Unknown column setting 'pk user_id int'
15
+
16
+ 2026-05-14T08:27:27.270Z
17
+
18
+ ./in-files/main.dbml(5,15): Expect an identifier
19
+ ./in-files/main.dbml(4,11): Unknown column setting 'pk user_id int'
20
+
21
+ 2026-05-14T08:28:07.657Z
22
+
23
+ ./in-files/main.dbml(5,15): Expect an identifier
24
+ ./in-files/main.dbml(4,11): Unknown column setting 'pk user_id int'
25
+
26
+ 2026-05-14T08:29:33.572Z
27
+
28
+ ./in-files/main.dbml(5,15): Expect an identifier
29
+ ./in-files/main.dbml(4,11): Unknown column setting 'pk user_id int'
30
+
31
+ 2026-05-14T08:35:30.939Z
32
+
33
+ ./in-files/main.dbml(5,15): Expect an identifier
34
+ ./in-files/main.dbml(4,11): Unknown column setting 'pk user_id int'
35
+
36
+ 2026-05-14T08:36:16.069Z
37
+
38
+ ./in-files/main.dbml(5,15): Expect an identifier
39
+ ./in-files/main.dbml(4,11): Unknown column setting 'pk user_id int'
40
+
41
+ 2026-05-14T08:39:23.228Z
42
+
43
+ ./in-files/main.dbml(5,15): Expect an identifier
44
+ ./in-files/main.dbml(4,11): Unknown column setting 'pk user_id int'
45
+
46
+ 2026-05-14T08:42:08.604Z
47
+
48
+ ./in-files/main.dbml(5,15): Expect an identifier
49
+ ./in-files/main.dbml(4,11): Unknown column setting 'pk user_id int'
50
+
51
+ 2026-05-14T08:42:53.495Z
52
+
53
+ ./in-files/main.dbml(5,15): Expect an identifier
54
+ ./in-files/main.dbml(4,11): Unknown column setting 'pk user_id int'
55
+
56
+ 2026-05-14T08:44:23.336Z
57
+
58
+ ./in-files/main.dbml(5,15): Expect an identifier
59
+ ./in-files/main.dbml(4,11): Unknown column setting 'pk user_id int'
60
+
61
+ 2026-05-14T08:46:36.316Z
62
+
63
+ ./in-files/main.dbml(5,15): Expect an identifier
64
+ ./in-files/main.dbml(4,11): Unknown column setting 'pk user_id int'
65
+
66
+ 2026-05-14T08:47:23.732Z
67
+
68
+ ./in-files/main.dbml(5,15): Expect an identifier
69
+ ./in-files/main.dbml(4,11): Unknown column setting 'pk user_id int'
70
+
71
+ 2026-05-14T09:17:17.515Z
72
+
73
+ ./in-files/main.dbml(5,15): Expect an identifier
74
+ ./in-files/main.dbml(5,15): Expect an identifier
75
+ ./in-files/main.dbml(4,11): Unknown column setting 'pk user_id int'
76
+
77
+ 2026-05-14T09:17:42.081Z
78
+
79
+ ./in-files/main.dbml(5,15): Expect an identifier
80
+ ./in-files/main.dbml(5,15): Expect an identifier
81
+ ./in-files/main.dbml(4,11): Unknown column setting 'pk user_id int'
82
+
83
+ 2026-05-14T09:24:38.125Z
84
+
85
+ ./in-files/main.dbml(5,15): Expect an identifier
86
+ ./in-files/main.dbml(4,11): Unknown column setting 'pk user_id int'
87
+
88
+ 2026-05-14T09:25:37.568Z
89
+
90
+ ./in-files/main.dbml(5,15): Expect an identifier
91
+ ./in-files/main.dbml(4,11): Unknown column setting 'pk user_id int'
92
+
93
+ 2026-05-14T15:04:03.503Z
94
+
95
+ ./in-files/main.dbml(5,15): Expect an identifier
96
+ ./in-files/main.dbml(4,11): Unknown column setting 'pk user_id int'
97
+
@@ -0,0 +1,4 @@
1
+ Table users {
2
+ id int [pk]
3
+ name varchar
4
+ }
@@ -0,0 +1,6 @@
1
+ use { table users } from './lib.dbml'
2
+
3
+ Table orders {
4
+ id int [pk
5
+ user_id int [ref: > users.id]
6
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "args": ["./in-files/main.dbml"]
3
+ }
@@ -0,0 +1,5 @@
1
+ ERROR:
2
+ ./in-files/main.dbml(5,15): Expect an identifier
3
+ ./in-files/main.dbml(4,11): Unknown column setting 'pk user_id int'
4
+
5
+ A complete log can be found in: