air-dml 1.2.9 → 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.
- package/README.md +18 -9
- package/dist/parser/index.d.ts +3 -2
- package/dist/parser/index.d.ts.map +1 -1
- package/dist/parser/index.js +8 -665
- package/dist/parser/index.js.map +1 -1
- package/dist/parser/new/ast.d.ts +101 -0
- package/dist/parser/new/ast.d.ts.map +1 -0
- package/dist/parser/new/ast.js +2 -0
- package/dist/parser/new/ast.js.map +1 -0
- package/dist/parser/new/index.d.ts +10 -0
- package/dist/parser/new/index.d.ts.map +1 -0
- package/dist/parser/new/index.js +232 -0
- package/dist/parser/new/index.js.map +1 -0
- package/dist/parser/new/lexer.d.ts +34 -0
- package/dist/parser/new/lexer.d.ts.map +1 -0
- package/dist/parser/new/lexer.js +308 -0
- package/dist/parser/new/lexer.js.map +1 -0
- package/dist/parser/new/parser.d.ts +62 -0
- package/dist/parser/new/parser.d.ts.map +1 -0
- package/dist/parser/new/parser.js +776 -0
- package/dist/parser/new/parser.js.map +1 -0
- package/dist/parser/new/tokens.d.ts +62 -0
- package/dist/parser/new/tokens.d.ts.map +1 -0
- package/dist/parser/new/tokens.js +83 -0
- package/dist/parser/new/tokens.js.map +1 -0
- package/dist/parser/new/transformer.d.ts +8 -0
- package/dist/parser/new/transformer.d.ts.map +1 -0
- package/dist/parser/new/transformer.js +154 -0
- package/dist/parser/new/transformer.js.map +1 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +8 -7
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ Generate ER diagrams from natural language using AI. Mode-ai is the reference im
|
|
|
32
32
|
🌍 **Multilingual**: Logical names (aliases) in any language
|
|
33
33
|
🎨 **Visual Design**: Coordinate and color information for diagram rendering
|
|
34
34
|
🔄 **Polyglot Persistence**: Different database types per area
|
|
35
|
-
📦 **Extends DBML**: Fully compatible with standard DBML
|
|
35
|
+
📦 **Extends DBML**: Fully compatible with standard DBML syntax
|
|
36
36
|
💬 **Comment Preservation**: Leading comments are preserved and associated with elements
|
|
37
37
|
|
|
38
38
|
## Installation
|
|
@@ -120,7 +120,6 @@ Table table_name [alias: "論理名", pos_x: 100, pos_y: 200, color: "#1976D2"]
|
|
|
120
120
|
| `unique` | Unique constraint | `email varchar [unique]` |
|
|
121
121
|
| `not null` | NOT NULL constraint | `name varchar [not null]` |
|
|
122
122
|
| `increment` | Auto increment | `id integer [pk, increment]` |
|
|
123
|
-
| `default: value` | Default value | `status text [default: 'active']` |
|
|
124
123
|
| `alias: "name"` | Logical name | `[alias: "ユーザーID"]` |
|
|
125
124
|
| `note: "desc"` | Column description | `[note: "説明"]` |
|
|
126
125
|
|
|
@@ -177,7 +176,7 @@ Table subscriptions [alias: "定期購入"] {
|
|
|
177
176
|
id serial [pk, alias: "定期購入ID"]
|
|
178
177
|
user_id integer [fk, not null, alias: "ユーザーID"]
|
|
179
178
|
product_id integer [fk, not null, alias: "商品ID"]
|
|
180
|
-
status text [not null,
|
|
179
|
+
status text [not null, alias: "ステータス"]
|
|
181
180
|
created_at timestamp [not null, alias: "作成日時"]
|
|
182
181
|
}
|
|
183
182
|
|
|
@@ -241,13 +240,13 @@ interface Column {
|
|
|
241
240
|
logicalName?: string; // alias
|
|
242
241
|
type: DataType;
|
|
243
242
|
typeParams?: string;
|
|
244
|
-
pk
|
|
245
|
-
fk
|
|
246
|
-
unique
|
|
247
|
-
notNull
|
|
248
|
-
increment
|
|
249
|
-
default?: string;
|
|
243
|
+
pk?: boolean;
|
|
244
|
+
fk?: boolean;
|
|
245
|
+
unique?: boolean;
|
|
246
|
+
notNull?: boolean;
|
|
247
|
+
increment?: boolean;
|
|
250
248
|
note?: string;
|
|
249
|
+
leadingComments?: string[]; // v1.2.0+
|
|
251
250
|
}
|
|
252
251
|
|
|
253
252
|
interface Reference {
|
|
@@ -292,6 +291,16 @@ interface Area {
|
|
|
292
291
|
|
|
293
292
|
## Changelog
|
|
294
293
|
|
|
294
|
+
### v2.1.0 (2025-01)
|
|
295
|
+
- **Breaking**: Removed `default` column constraint from syntax
|
|
296
|
+
- Simplified parser by removing inconsistent quote handling for default values
|
|
297
|
+
|
|
298
|
+
### v2.0.0 (2025-01)
|
|
299
|
+
- **Major**: Replaced `@dbml/core` dependency with custom hand-written recursive descent parser
|
|
300
|
+
- Full AIR-DML syntax support without external dependencies
|
|
301
|
+
- Improved error messages in Japanese
|
|
302
|
+
- Better handling of Japanese identifiers and comments
|
|
303
|
+
|
|
295
304
|
### v1.2.3 (2025-01)
|
|
296
305
|
- Bug fixes for Area parsing with Japanese names
|
|
297
306
|
- Improved comment preservation
|
package/dist/parser/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
export { parseAirDML as parseAirDMLResult, exportToAirDML, Lexer, LexerError, Parser, ParseError, transformAstToDiagram, } from './new';
|
|
2
|
+
import type { Diagram, ParseResult } from '../types';
|
|
2
3
|
export declare function parseAirDML(airDmlText: string, diagramId?: string): Diagram;
|
|
3
|
-
export declare function
|
|
4
|
+
export declare function parseAirDMLSafe(airDmlText: string, diagramId?: string): ParseResult;
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/parser/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/parser/index.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,WAAW,IAAI,iBAAiB,EAChC,cAAc,EACd,KAAK,EACL,UAAU,EACV,MAAM,EACN,UAAU,EACV,qBAAqB,GACtB,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAqBrD,wBAAgB,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAQ3E;AA0BD,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,EAClB,SAAS,CAAC,EAAE,MAAM,GACjB,WAAW,CAEb"}
|