@dbml/parse 10.1.1 → 10.2.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.
@@ -1,6 +1,8 @@
1
1
  import { default as Compiler } from '../../../compiler';
2
2
  import { CompileError } from '../../types/errors';
3
- import { BlockExpressionNode, ElementDeclarationNode, FunctionApplicationNode } from '../../types/nodes';
3
+ import { BlockExpressionNode, ElementDeclarationNode, FunctionApplicationNode, ListExpressionNode } from '../../types/nodes';
4
+ import { default as Report } from '../../types/report';
5
+ import { Settings } from '../../utils/validate';
4
6
  export default class RecordsValidator {
5
7
  private declarationNode;
6
8
  private compiler;
@@ -18,3 +20,4 @@ export default class RecordsValidator {
18
20
  private isValidRecordValue;
19
21
  private validateSubElements;
20
22
  }
23
+ export declare function validateRecordsSettings(settingList?: ListExpressionNode): Report<Settings>;
@@ -102,13 +102,16 @@ export declare enum CompileErrorCode {
102
102
  INVALID_RECORDS_FIELD = 3084,
103
103
  DUPLICATE_COLUMN_REFERENCES_IN_RECORDS = 3085,
104
104
  DUPLICATE_RECORDS_FOR_TABLE = 3086,
105
- INVALID_USE_CONTEXT = 3087,
106
- INVALID_USE_SPECIFIER_KIND = 3088,
107
- INVALID_USE_SPECIFIER_NAME = 3089,
108
- INVALID_DIAGRAMVIEW_CONTEXT = 3090,
109
- DUPLICATE_DIAGRAMVIEW_NAME = 3091,
110
- INVALID_DIAGRAMVIEW_FIELD = 3092,
111
- DUPLICATE_DIAGRAMVIEW_FIELD = 3093,
105
+ UNKNOWN_RECORDS_SETTING = 3087,
106
+ DUPLICATE_RECORDS_SETTING = 3088,
107
+ INVALID_RECORDS_SETTING_VALUE = 3089,
108
+ INVALID_USE_CONTEXT = 3090,
109
+ INVALID_USE_SPECIFIER_KIND = 3091,
110
+ INVALID_USE_SPECIFIER_NAME = 3092,
111
+ INVALID_DIAGRAMVIEW_CONTEXT = 3093,
112
+ DUPLICATE_DIAGRAMVIEW_NAME = 3094,
113
+ INVALID_DIAGRAMVIEW_FIELD = 3095,
114
+ DUPLICATE_DIAGRAMVIEW_FIELD = 3096,
112
115
  BINDING_ERROR = 4000,
113
116
  NONEXISTENT_MODULE = 4001,
114
117
  UNSUPPORTED = 5000,
@@ -35,5 +35,6 @@ export declare enum SettingName {
35
35
  Check = "check",
36
36
  Update = "update",
37
37
  Delete = "delete",
38
- Inactive = "inactive"
38
+ Inactive = "inactive",
39
+ Example = "example"
39
40
  }
@@ -276,6 +276,7 @@ export interface TableRecord {
276
276
  tableName: string;
277
277
  columns: string[];
278
278
  values: RecordValue[][];
279
+ example?: boolean;
279
280
  token: TokenPosition;
280
281
  }
281
282
  export type MetadataValues = Record<string, {
@@ -105,6 +105,7 @@ export declare class RecordsMetadata extends NodeMetadata {
105
105
  readonly kind = MetadataKind.Records;
106
106
  constructor(declaration: SyntaxNode);
107
107
  table(compiler: Compiler): TableSymbol | undefined;
108
+ example(compiler: Compiler): boolean;
108
109
  owners(compiler: Compiler): NodeSymbol[];
109
110
  }
110
111
  export declare class MetadataElementMetadata extends NodeMetadata {
@@ -15,7 +15,7 @@ export { type Database, type MasterDatabase, type Table, type Note, type Column,
15
15
  export { type RelationCardinality, type RelationshipOp, getRelationshipOp, getMultiplicities, parseCardinality, makeCardinalityRequired, makeCardinalityOptional, makeRelationshipRequired, isEndpointOneSide, isEndpointManySide, isEndpointOptional, isEndpointRequired, CARDINALITY_ONE, CARDINALITY_MAYBE, CARDINALITY_SOME, CARDINALITY_MANY, } from './core/types/relation';
16
16
  export type { DiagramViewSyncOperation, DiagramViewBlock, TextEdit, } from './compiler/queries/transform';
17
17
  export { findDiagramViewBlocks } from './compiler/queries/transform';
18
- export type { DepSyncOperation, DepSyncEdge, DepEndpointRef, } from './compiler/queries/transform';
18
+ export type { DepSyncOperation, DepSyncEdge, DepEndpointRef } from './compiler/queries/transform';
19
19
  export type { ElementIdentifier, SchemaIdentifier, TableIdentifier, ColumnIdentifier, EnumIdentifier, EndpointRef, RefIdentifier, DepIdentifier, NoteIdentifier, TableGroupIdentifier, } from './compiler/queries/transform';
20
20
  export { dbmlLanguageConfig, dbmlMonarchTokensProvider, } from './services/monarch';
21
21
  export * from './compiler/projectLayout/layout';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package",
3
3
  "name": "@dbml/parse",
4
- "version": "10.1.1",
4
+ "version": "10.2.0",
5
5
  "description": "DBML parser v2",
6
6
  "author": "Holistics <dev@holistics.io>",
7
7
  "license": "Apache-2.0",
@@ -51,5 +51,5 @@
51
51
  "engines": {
52
52
  "node": ">=18"
53
53
  },
54
- "gitHead": "55464498db51a06a228981d5a57d5f9d870fe3e7"
54
+ "gitHead": "c0844906edf50438efe35207712d1c06eac53ef0"
55
55
  }