@dbml/parse 9.0.0-alpha.13 → 9.0.0-alpha.15

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.
@@ -12,22 +12,6 @@ export declare class DepInterpreter {
12
12
  interpret(): Report<Dep>;
13
13
  private interpretName;
14
14
  private interpretEdges;
15
- /**
16
- * Read settings into `dep.note` and `dep.metadata`.
17
- *
18
- * Settings come from THREE sources, in this order:
19
- * 1. The top-level attribute list on the Dep header
20
- * (e.g. `Dep my_block [color: 'blue'] { ... }`).
21
- * 2. Per-field setting lists inside the body
22
- * (e.g. `Dep { a -> b [note: 'x'] }`).
23
- * 3. Sub-element declarations inside the body
24
- * (e.g. `Dep { a -> b; note: 'x'; materialized: 'view' }`).
25
- *
26
- * All three sources write into the same `metadata` object (with `note`
27
- * routed to the typed slot instead). Precedence is last-write-wins by
28
- * virtue of plain object assignment — settings later in the source
29
- * file overwrite earlier ones with the same key.
30
- */
31
15
  private interpretSettings;
32
16
  private consumeSettings;
33
17
  private extractAttrValue;
@@ -17,7 +17,5 @@ export default class ProgramInterpreter {
17
17
  private interpretUseSymbol;
18
18
  private interpretAllMetadata;
19
19
  private interpretAllAliases;
20
- private validateRecords;
21
- private collectPartialRefs;
22
20
  private pushElement;
23
21
  }
@@ -0,0 +1,4 @@
1
+ import { CompileError } from '../../../types/errors';
2
+ import { Dep } from '../../../types/schemaJson';
3
+ import { NodeMetadata } from '../../../types/symbol/metadata';
4
+ export declare function validateDepBlocks(dep: Dep, meta: NodeMetadata, seenDownstream: Map<string, boolean>): CompileError[];
@@ -0,0 +1,3 @@
1
+ import { Database, ElementRef } from '../../../types/schemaJson';
2
+ import { NodeSymbol } from '../../../types/symbol';
3
+ export declare function pushExternal(db: Database, member: NodeSymbol, ref: ElementRef): void;
@@ -0,0 +1,3 @@
1
+ export { pushExternal } from './external';
2
+ export { validateRecords } from './records';
3
+ export { validateDepBlocks } from './dep';
@@ -0,0 +1,6 @@
1
+ import { default as Compiler } from '../../../../compiler/index';
2
+ import { CompileWarning } from '../../../types/errors';
3
+ import { Filepath } from '../../../types/filepath';
4
+ import { Ref } from '../../../types/schemaJson';
5
+ import { ProgramSymbol } from '../../../types/symbol';
6
+ export declare function validateRecords(compiler: Compiler, programSymbol: ProgramSymbol, refs: Ref[], filepath: Filepath): CompileWarning[];
@@ -114,9 +114,11 @@ export declare enum CompileErrorCode {
114
114
  CIRCULAR_REF = 5001,
115
115
  SAME_ENDPOINT = 5002,
116
116
  DEP_SELF_LOOP = 5003,
117
- UNEQUAL_FIELDS_BINARY_REF = 5004,
118
- CONFLICTING_SETTING = 5005,
119
- TABLE_REAPPEAR_IN_TABLEGROUP = 5006
117
+ DEP_MIXED_DOWNSTREAM_TABLES = 5004,
118
+ DEP_DUPLICATE_DOWNSTREAM_TABLE = 5005,
119
+ UNEQUAL_FIELDS_BINARY_REF = 5006,
120
+ CONFLICTING_SETTING = 5007,
121
+ TABLE_REAPPEAR_IN_TABLEGROUP = 5008
120
122
  }
121
123
  export declare class CompileError extends Error {
122
124
  code: Readonly<CompileErrorCode>;
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": "9.0.0-alpha.13",
4
+ "version": "9.0.0-alpha.15",
5
5
  "description": "DBML parser v2",
6
6
  "author": "Holistics <dev@holistics.io>",
7
7
  "license": "Apache-2.0",
@@ -50,5 +50,5 @@
50
50
  "engines": {
51
51
  "node": ">=18"
52
52
  },
53
- "gitHead": "aad3f5808c07679bd201d4da15561beb8abf05f1"
53
+ "gitHead": "6b55b7c469c1f577c3e27fa699d107ecbd4c47d2"
54
54
  }
@@ -1,3 +0,0 @@
1
- import { Database, ElementRef } from '../../types/schemaJson';
2
- import { NodeSymbol } from '../../types/symbol';
3
- export declare function pushExternal(db: Database, member: NodeSymbol, ref: ElementRef): void;