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 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, powered by `@dbml/core`
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, default: 'active', alias: "ステータス"]
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: boolean;
245
- fk: boolean;
246
- unique: boolean;
247
- notNull: boolean;
248
- increment: boolean;
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
@@ -1,4 +1,5 @@
1
- import type { Diagram } from '../types';
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 exportToAirDML(diagram: Diagram): string;
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":"AAOA,OAAO,KAAK,EACV,OAAO,EAOR,MAAM,UAAU,CAAC;AA0BlB,wBAAgB,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAuL3E;AAOD,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAoLvD"}
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"}