@dbml/parse 9.0.0-alpha.2 → 9.0.0-optional-ref.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/LICENSE +0 -0
- package/dist/__benchmarks__/compiler.benchmark.d.ts +0 -0
- package/dist/__benchmarks__/compiler.profile.d.ts +0 -0
- package/dist/dbml-parse.js +19 -22
- package/dist/dbml-parse.mjs +3932 -4398
- package/dist/index.d.ts +0 -0
- package/dist/src/compiler/index.d.ts +3 -8
- package/dist/src/compiler/projectLayout/index.d.ts +0 -0
- package/dist/src/compiler/projectLayout/layout.d.ts +0 -0
- package/dist/src/compiler/queries/canonicalName.d.ts +0 -0
- package/dist/src/compiler/queries/container/element.d.ts +0 -0
- package/dist/src/compiler/queries/container/index.d.ts +0 -0
- package/dist/src/compiler/queries/container/scope.d.ts +0 -0
- package/dist/src/compiler/queries/container/scopeKind.d.ts +0 -0
- package/dist/src/compiler/queries/container/stack.d.ts +0 -0
- package/dist/src/compiler/queries/container/token.d.ts +0 -0
- package/dist/src/compiler/queries/files/fileDependencies.d.ts +0 -0
- package/dist/src/compiler/queries/files/reachableFiles.d.ts +0 -0
- package/dist/src/compiler/queries/files/usableMembers.d.ts +0 -0
- package/dist/src/compiler/queries/legacy/parse.d.ts +0 -0
- package/dist/src/compiler/queries/legacy/symbol.d.ts +0 -0
- package/dist/src/compiler/queries/legacy/token.d.ts +0 -0
- package/dist/src/compiler/queries/nodeAtPosition.d.ts +0 -0
- package/dist/src/compiler/queries/pipeline/bind.d.ts +0 -0
- package/dist/src/compiler/queries/pipeline/index.d.ts +0 -0
- package/dist/src/compiler/queries/pipeline/interpret.d.ts +0 -0
- package/dist/src/compiler/queries/pipeline/parse.d.ts +0 -0
- package/dist/src/compiler/queries/pipeline/validate.d.ts +0 -0
- package/dist/src/compiler/queries/resolutionIndex.d.ts +0 -0
- package/dist/src/compiler/queries/symbol/lookupMembers.d.ts +0 -0
- package/dist/src/compiler/queries/symbol/symbolAliases.d.ts +0 -0
- package/dist/src/compiler/queries/symbol/symbolUses.d.ts +0 -0
- package/dist/src/compiler/queries/transform/applyTextEdits.d.ts +0 -0
- package/dist/src/compiler/queries/transform/index.d.ts +0 -1
- package/dist/src/compiler/queries/transform/renameTable.d.ts +0 -0
- package/dist/src/compiler/queries/transform/syncDiagramView.d.ts +0 -0
- package/dist/src/compiler/queries/transform/utils.d.ts +0 -0
- package/dist/src/compiler/queries/utils.d.ts +0 -0
- package/dist/src/compiler/types.d.ts +0 -0
- package/dist/src/constants.d.ts +0 -0
- package/dist/src/core/global_modules/checks/bind.d.ts +0 -0
- package/dist/src/core/global_modules/checks/index.d.ts +0 -0
- package/dist/src/core/global_modules/checks/interpret.d.ts +0 -0
- package/dist/src/core/global_modules/diagramView/bind.d.ts +0 -0
- package/dist/src/core/global_modules/diagramView/index.d.ts +0 -0
- package/dist/src/core/global_modules/diagramView/interpret.d.ts +0 -0
- package/dist/src/core/global_modules/enum/bind.d.ts +0 -0
- package/dist/src/core/global_modules/enum/index.d.ts +0 -0
- package/dist/src/core/global_modules/enum/interpret.d.ts +0 -0
- package/dist/src/core/global_modules/index.d.ts +0 -0
- package/dist/src/core/global_modules/indexes/bind.d.ts +0 -0
- package/dist/src/core/global_modules/indexes/index.d.ts +0 -0
- package/dist/src/core/global_modules/indexes/interpret.d.ts +0 -0
- package/dist/src/core/global_modules/note/bind.d.ts +0 -0
- package/dist/src/core/global_modules/note/index.d.ts +0 -0
- package/dist/src/core/global_modules/note/interpret.d.ts +0 -0
- package/dist/src/core/global_modules/program/bind.d.ts +0 -0
- package/dist/src/core/global_modules/program/index.d.ts +0 -0
- package/dist/src/core/global_modules/program/interpret.d.ts +0 -0
- package/dist/src/core/global_modules/program/utils.d.ts +0 -0
- package/dist/src/core/global_modules/project/bind.d.ts +0 -0
- package/dist/src/core/global_modules/project/index.d.ts +0 -0
- package/dist/src/core/global_modules/project/interpret.d.ts +0 -0
- package/dist/src/core/global_modules/records/bind.d.ts +0 -0
- package/dist/src/core/global_modules/records/index.d.ts +0 -0
- package/dist/src/core/global_modules/records/interpret.d.ts +0 -0
- package/dist/src/core/global_modules/records/utils/constraints/fk.d.ts +0 -0
- package/dist/src/core/global_modules/records/utils/constraints/helper.d.ts +0 -0
- package/dist/src/core/global_modules/records/utils/constraints/index.d.ts +0 -0
- package/dist/src/core/global_modules/records/utils/constraints/pk.d.ts +0 -0
- package/dist/src/core/global_modules/records/utils/constraints/unique.d.ts +0 -0
- package/dist/src/core/global_modules/records/utils/data/index.d.ts +0 -0
- package/dist/src/core/global_modules/records/utils/data/sqlTypes.d.ts +0 -0
- package/dist/src/core/global_modules/records/utils/data/values.d.ts +0 -0
- package/dist/src/core/global_modules/records/utils/index.d.ts +0 -0
- package/dist/src/core/global_modules/ref/bind.d.ts +0 -0
- package/dist/src/core/global_modules/ref/index.d.ts +0 -1
- package/dist/src/core/global_modules/ref/interpret.d.ts +2 -0
- package/dist/src/core/global_modules/schema/index.d.ts +0 -0
- package/dist/src/core/global_modules/table/bind.d.ts +0 -2
- package/dist/src/core/global_modules/table/index.d.ts +0 -0
- package/dist/src/core/global_modules/table/interpret.d.ts +0 -0
- package/dist/src/core/global_modules/table/utils.d.ts +0 -0
- package/dist/src/core/global_modules/tableGroup/bind.d.ts +0 -0
- package/dist/src/core/global_modules/tableGroup/index.d.ts +0 -0
- package/dist/src/core/global_modules/tableGroup/interpret.d.ts +0 -0
- package/dist/src/core/global_modules/tablePartial/bind.d.ts +0 -0
- package/dist/src/core/global_modules/tablePartial/index.d.ts +0 -0
- package/dist/src/core/global_modules/tablePartial/interpret.d.ts +0 -0
- package/dist/src/core/global_modules/types.d.ts +0 -0
- package/dist/src/core/global_modules/use/index.d.ts +0 -0
- package/dist/src/core/global_modules/utils.d.ts +0 -2
- package/dist/src/core/lexer/lexer.d.ts +0 -0
- package/dist/src/core/lexer/utils.d.ts +0 -0
- package/dist/src/core/local_modules/checks/index.d.ts +0 -0
- package/dist/src/core/local_modules/checks/validate.d.ts +0 -0
- package/dist/src/core/local_modules/custom/index.d.ts +0 -0
- package/dist/src/core/local_modules/custom/validate.d.ts +0 -0
- package/dist/src/core/local_modules/diagramView/index.d.ts +0 -0
- package/dist/src/core/local_modules/diagramView/validate.d.ts +0 -0
- package/dist/src/core/local_modules/enum/index.d.ts +0 -0
- package/dist/src/core/local_modules/enum/validate.d.ts +0 -0
- package/dist/src/core/local_modules/index.d.ts +0 -0
- package/dist/src/core/local_modules/indexes/index.d.ts +0 -0
- package/dist/src/core/local_modules/indexes/validate.d.ts +0 -0
- package/dist/src/core/local_modules/note/index.d.ts +0 -0
- package/dist/src/core/local_modules/note/validate.d.ts +0 -0
- package/dist/src/core/local_modules/program/index.d.ts +0 -0
- package/dist/src/core/local_modules/program/validate.d.ts +0 -0
- package/dist/src/core/local_modules/project/index.d.ts +0 -0
- package/dist/src/core/local_modules/project/validate.d.ts +0 -0
- package/dist/src/core/local_modules/records/index.d.ts +0 -0
- package/dist/src/core/local_modules/records/validate.d.ts +0 -0
- package/dist/src/core/local_modules/ref/index.d.ts +0 -0
- package/dist/src/core/local_modules/ref/validate.d.ts +0 -0
- package/dist/src/core/local_modules/table/index.d.ts +0 -0
- package/dist/src/core/local_modules/table/validate.d.ts +0 -0
- package/dist/src/core/local_modules/tableGroup/index.d.ts +0 -0
- package/dist/src/core/local_modules/tableGroup/validate.d.ts +0 -0
- package/dist/src/core/local_modules/tablePartial/index.d.ts +0 -0
- package/dist/src/core/local_modules/tablePartial/validate.d.ts +0 -0
- package/dist/src/core/local_modules/types.d.ts +0 -0
- package/dist/src/core/local_modules/use/index.d.ts +0 -0
- package/dist/src/core/local_modules/use/validate.d.ts +0 -0
- package/dist/src/core/parser/contextStack.d.ts +0 -0
- package/dist/src/core/parser/factory.d.ts +0 -0
- package/dist/src/core/parser/parser.d.ts +0 -0
- package/dist/src/core/parser/utils.d.ts +0 -0
- package/dist/src/core/types/errors.d.ts +50 -52
- package/dist/src/core/types/filepath.d.ts +0 -0
- package/dist/src/core/types/index.d.ts +0 -0
- package/dist/src/core/types/internable.d.ts +0 -0
- package/dist/src/core/types/keywords.d.ts +0 -2
- package/dist/src/core/types/module.d.ts +0 -0
- package/dist/src/core/types/nodes.d.ts +0 -0
- package/dist/src/core/types/position.d.ts +0 -0
- package/dist/src/core/types/relation.d.ts +16 -0
- package/dist/src/core/types/report.d.ts +0 -0
- package/dist/src/core/types/schemaJson.d.ts +3 -35
- package/dist/src/core/types/symbol/factory.d.ts +0 -0
- package/dist/src/core/types/symbol/index.d.ts +0 -0
- package/dist/src/core/types/symbol/metadata.d.ts +22 -17
- package/dist/src/core/types/symbol/symbols.d.ts +0 -0
- package/dist/src/core/types/tokens.d.ts +0 -0
- package/dist/src/core/utils/chars.d.ts +0 -0
- package/dist/src/core/utils/expression.d.ts +0 -0
- package/dist/src/core/utils/interpret.d.ts +0 -0
- package/dist/src/core/utils/numbers.d.ts +0 -0
- package/dist/src/core/utils/span.d.ts +0 -0
- package/dist/src/core/utils/tokens.d.ts +0 -0
- package/dist/src/core/utils/validate.d.ts +0 -0
- package/dist/src/index.d.ts +2 -2
- package/dist/src/services/definition/provider.d.ts +0 -0
- package/dist/src/services/diagnostics/provider.d.ts +0 -0
- package/dist/src/services/index.d.ts +0 -0
- package/dist/src/services/monarch.d.ts +0 -0
- package/dist/src/services/references/provider.d.ts +0 -0
- package/dist/src/services/suggestions/crossFile.d.ts +0 -0
- package/dist/src/services/suggestions/provider.d.ts +0 -0
- package/dist/src/services/suggestions/recordRowSnippet.d.ts +0 -0
- package/dist/src/services/suggestions/use.d.ts +0 -0
- package/dist/src/services/suggestions/utils/index.d.ts +0 -0
- package/dist/src/services/suggestions/utils/useMerger.d.ts +0 -0
- package/dist/src/services/types.d.ts +0 -0
- package/dist/src/services/utils.d.ts +0 -0
- package/package.json +2 -2
- package/dist/src/compiler/queries/transform/syncDep.d.ts +0 -90
- package/dist/src/core/global_modules/dep/bind.d.ts +0 -15
- package/dist/src/core/global_modules/dep/index.d.ts +0 -2
- package/dist/src/core/global_modules/dep/interpret.d.ts +0 -34
- package/dist/src/core/local_modules/dep/index.d.ts +0 -2
- package/dist/src/core/local_modules/dep/validate.d.ts +0 -18
|
File without changes
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { default as Compiler } from '../../../compiler';
|
|
2
|
-
import { AttributeNode, ElementDeclarationNode,
|
|
2
|
+
import { AttributeNode, ElementDeclarationNode, SyntaxNode } from '../nodes';
|
|
3
3
|
import { ColumnSymbol, NodeSymbol, TablePartialSymbol, TableSymbol } from '../symbol';
|
|
4
4
|
import { Internable } from '../internable';
|
|
5
|
+
import { RelationshipOp, RelationCardinality } from '../relation';
|
|
5
6
|
export declare enum MetadataKind {
|
|
6
7
|
Ref = "ref",
|
|
7
|
-
Dep = "dep",
|
|
8
8
|
PartialRef = "partial ref",
|
|
9
9
|
TableChecks = "table checks",
|
|
10
10
|
Indexes = "indexes",
|
|
@@ -37,25 +37,21 @@ export declare class RefMetadata extends NodeMetadata {
|
|
|
37
37
|
rightColumns(compiler: Compiler): ColumnSymbol[];
|
|
38
38
|
leftTable(compiler: Compiler): TableSymbol | undefined;
|
|
39
39
|
rightTable(compiler: Compiler): TableSymbol | undefined;
|
|
40
|
-
op(_compiler: Compiler):
|
|
40
|
+
op(_compiler: Compiler): RelationshipOp | undefined;
|
|
41
|
+
cardinalities(compiler: Compiler): [RelationCardinality, RelationCardinality] | undefined;
|
|
42
|
+
leftCardinality(compiler: Compiler): {
|
|
43
|
+
min: number;
|
|
44
|
+
max: number | '*';
|
|
45
|
+
} | undefined;
|
|
46
|
+
rightCardinality(compiler: Compiler): {
|
|
47
|
+
min: number;
|
|
48
|
+
max: number | '*';
|
|
49
|
+
} | undefined;
|
|
41
50
|
active(compiler: Compiler): boolean;
|
|
42
51
|
leftToken(): SyntaxNode;
|
|
43
52
|
rightToken(): SyntaxNode;
|
|
44
53
|
owners(compiler: Compiler): NodeSymbol[];
|
|
45
54
|
}
|
|
46
|
-
export declare class DepMetadata extends NodeMetadata {
|
|
47
|
-
declaration: ElementDeclarationNode | AttributeNode;
|
|
48
|
-
readonly kind = MetadataKind.Dep;
|
|
49
|
-
constructor(declaration: ElementDeclarationNode | AttributeNode);
|
|
50
|
-
container(compiler: Compiler): TableSymbol | undefined;
|
|
51
|
-
edgeExpressions(): InfixExpressionNode[];
|
|
52
|
-
upstreamColumns(compiler: Compiler): ColumnSymbol[][];
|
|
53
|
-
downstreamColumns(compiler: Compiler): ColumnSymbol[][];
|
|
54
|
-
upstreamTables(compiler: Compiler): (TableSymbol | undefined)[];
|
|
55
|
-
downstreamTables(compiler: Compiler): (TableSymbol | undefined)[];
|
|
56
|
-
private hostColumn;
|
|
57
|
-
owners(compiler: Compiler): NodeSymbol[];
|
|
58
|
-
}
|
|
59
55
|
export declare class PartialRefMetadata extends NodeMetadata {
|
|
60
56
|
readonly kind = MetadataKind.PartialRef;
|
|
61
57
|
constructor(declaration: SyntaxNode);
|
|
@@ -64,7 +60,16 @@ export declare class PartialRefMetadata extends NodeMetadata {
|
|
|
64
60
|
rightColumns(compiler: Compiler): ColumnSymbol[];
|
|
65
61
|
leftTablePartial(compiler: Compiler): TablePartialSymbol | undefined;
|
|
66
62
|
rightTable(compiler: Compiler): TableSymbol | TablePartialSymbol | undefined;
|
|
67
|
-
op(_compiler: Compiler):
|
|
63
|
+
op(_compiler: Compiler): RelationshipOp | undefined;
|
|
64
|
+
cardinalities(compiler: Compiler): [RelationCardinality, RelationCardinality] | undefined;
|
|
65
|
+
leftCardinality(compiler: Compiler): {
|
|
66
|
+
min: number;
|
|
67
|
+
max: number | '*';
|
|
68
|
+
} | undefined;
|
|
69
|
+
rightCardinality(compiler: Compiler): {
|
|
70
|
+
min: number;
|
|
71
|
+
max: number | '*';
|
|
72
|
+
} | undefined;
|
|
68
73
|
leftToken(): SyntaxNode;
|
|
69
74
|
rightToken(): SyntaxNode;
|
|
70
75
|
owners(compiler: Compiler): NodeSymbol[];
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/src/index.d.ts
CHANGED
|
@@ -10,9 +10,9 @@ export { SyntaxToken, SyntaxTokenKind, isTriviaToken, isOp, isOpToken, } from '.
|
|
|
10
10
|
export { CompileError, CompileErrorCode, } from './core/types/errors';
|
|
11
11
|
export type { Position, } from './core/types';
|
|
12
12
|
export { ScopeKind, splitQualifiedIdentifier, unescapeString, escapeString, formatRecordValue, isValidIdentifier, addDoubleQuoteIfNeeded, } from './compiler/index';
|
|
13
|
-
export { type Database, type MasterDatabase, type Table, type Note, type Column, type ColumnType, type Index, type Check, type InlineRef, type Ref, type RefEndpointPair, type RefEndpoint, type
|
|
13
|
+
export { type Database, type MasterDatabase, type Table, type Note, type Column, type ColumnType, type Index, type Check, type InlineRef, type Ref, type RefEndpointPair, type RefEndpoint, type Enum, type EnumField, type TableGroup, type TableGroupField, type Alias, type AliasKind, type TablePartial, type TablePartialInjection, type RecordValue, type RecordValueType, type TableRecord, type Project, type SchemaElement, type TokenPosition, type ElementRef, type FilterConfig, type DiagramView, } from './core/types/schemaJson';
|
|
14
|
+
export { type RelationCardinality, type RelationshipOp, getRelationshipOp, getMultiplicities, parseCardinality, CARDINALITY_ONE, CARDINALITY_MAYBE, CARDINALITY_SOME, CARDINALITY_MANY, } from './core/types/relation';
|
|
14
15
|
export type { DiagramViewSyncOperation, DiagramViewBlock, TextEdit, } from './compiler/queries/transform';
|
|
15
|
-
export type { DepSyncOperation, DepSyncEdge, DepEndpointRef, DepBlock, } from './compiler/queries/transform';
|
|
16
16
|
export { dbmlLanguageConfig, dbmlMonarchTokensProvider, } from './services/monarch';
|
|
17
17
|
export * from './compiler/projectLayout/layout';
|
|
18
18
|
export { Compiler };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
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-
|
|
4
|
+
"version": "9.0.0-optional-ref.0",
|
|
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": "
|
|
53
|
+
"gitHead": "01feeb4d524ff11d6cfaad16730a27c73e0d3b1f"
|
|
54
54
|
}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { Filepath } from '../../../core/types/filepath';
|
|
2
|
-
import { default as Compiler } from '../../index';
|
|
3
|
-
import { TextEdit } from './applyTextEdits';
|
|
4
|
-
/** One endpoint of a dep edge. `fieldNames` is empty for a table-level edge. */
|
|
5
|
-
export interface DepEndpointRef {
|
|
6
|
-
schemaName?: string | null;
|
|
7
|
-
tableName: string;
|
|
8
|
-
fieldNames?: string[];
|
|
9
|
-
}
|
|
10
|
-
export interface DepSyncEdge {
|
|
11
|
-
upstream: DepEndpointRef;
|
|
12
|
-
downstream: DepEndpointRef;
|
|
13
|
-
}
|
|
14
|
-
export interface DepSyncOperation {
|
|
15
|
-
operation: 'create' | 'update';
|
|
16
|
-
/** The edge that identifies the target block (table-level: empty fieldNames). */
|
|
17
|
-
edge: DepSyncEdge;
|
|
18
|
-
color?: string;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* A `color` setting found on a block.
|
|
22
|
-
*
|
|
23
|
-
* `kind` says how to overwrite it:
|
|
24
|
-
* - `attribute` -> replace just the `color: <hex>` attribute at `start..end`
|
|
25
|
-
* (inside a `[...]` list that may hold other settings).
|
|
26
|
-
* - `subDeclaration` -> replace the whole `color: <hex>` body line at
|
|
27
|
-
* `start..end`.
|
|
28
|
-
*/
|
|
29
|
-
interface ColorSetting {
|
|
30
|
-
kind: 'attribute' | 'subDeclaration';
|
|
31
|
-
start: number;
|
|
32
|
-
end: number;
|
|
33
|
-
}
|
|
34
|
-
export interface DepBlock {
|
|
35
|
-
startIndex: number;
|
|
36
|
-
endIndex: number;
|
|
37
|
-
edges: DepSyncEdge[];
|
|
38
|
-
/**
|
|
39
|
-
* An existing header `[...]` attribute list (without a color setting), so a
|
|
40
|
-
* color can be inserted into it instead of adding a second `[...]`.
|
|
41
|
-
* Records the offset just before the list's closing `]`.
|
|
42
|
-
*/
|
|
43
|
-
attributeListInsertAt?: number;
|
|
44
|
-
attributeListIsEmpty?: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* Offset of the block body `{` - where to add a header `[color: ...]` for a
|
|
47
|
-
* block-form Dep that has no attribute list.
|
|
48
|
-
*/
|
|
49
|
-
bodyOpenAt?: number;
|
|
50
|
-
/**
|
|
51
|
-
* End offset of a short-form (`Dep: a -> b`) body that has no setting list -
|
|
52
|
-
* where to append ` [color: ...]`.
|
|
53
|
-
*/
|
|
54
|
-
shortFormEnd?: number;
|
|
55
|
-
/** The existing color setting (header list, inline list, or sub-declaration), if any. */
|
|
56
|
-
color?: ColorSetting;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Returns every `Dep` block in `source`.
|
|
60
|
-
* On any lex or parse error, returns [] - there is no reliable way to read
|
|
61
|
-
* dep blocks from malformed DBML (mirrors findDiagramViewBlocks).
|
|
62
|
-
*/
|
|
63
|
-
export declare function findDepBlocks(source: string): DepBlock[];
|
|
64
|
-
export interface InlineDep {
|
|
65
|
-
edge: DepSyncEdge;
|
|
66
|
-
stripStart: number;
|
|
67
|
-
stripEnd: number;
|
|
68
|
-
}
|
|
69
|
-
export declare function findInlineDeps(source: string): InlineDep[];
|
|
70
|
-
/**
|
|
71
|
-
* Emit a `Dep` block for one edge with a `[color]` setting:
|
|
72
|
-
*
|
|
73
|
-
* Dep [color: <hex>] {
|
|
74
|
-
* <upstream> -> <downstream>
|
|
75
|
-
* }
|
|
76
|
-
*/
|
|
77
|
-
export declare function generateDepBlock(edge: DepSyncEdge, color: string): string;
|
|
78
|
-
/**
|
|
79
|
-
* Synchronizes `Dep` blocks in the DBML source at `filepath`.
|
|
80
|
-
*
|
|
81
|
-
* @param filepath The file whose source should be rewritten.
|
|
82
|
-
* @param operations Array of create/update operations to apply.
|
|
83
|
-
* @param blocks Optional pre-parsed blocks from findDepBlocks.
|
|
84
|
-
* @returns The new DBML source and the text edits applied.
|
|
85
|
-
*/
|
|
86
|
-
export declare function syncDep(this: Compiler, filepath: Filepath, operations: DepSyncOperation[], blocks?: DepBlock[]): {
|
|
87
|
-
newDbml: string;
|
|
88
|
-
edits: TextEdit[];
|
|
89
|
-
};
|
|
90
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { default as Compiler } from '../../../compiler';
|
|
2
|
-
import { CompileError } from '../../types/errors';
|
|
3
|
-
import { ElementDeclarationNode } from '../../types/nodes';
|
|
4
|
-
import { SyntaxToken } from '../../types/tokens';
|
|
5
|
-
export default class DepBinder {
|
|
6
|
-
private compiler;
|
|
7
|
-
private declarationNode;
|
|
8
|
-
constructor(compiler: Compiler, declarationNode: ElementDeclarationNode & {
|
|
9
|
-
type: SyntaxToken;
|
|
10
|
-
});
|
|
11
|
-
bind(): CompileError[];
|
|
12
|
-
private bindBody;
|
|
13
|
-
private bindFields;
|
|
14
|
-
private bindSubElements;
|
|
15
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { Dep } from '../../types/schemaJson';
|
|
2
|
-
import { DepMetadata, Filepath } from '../../types';
|
|
3
|
-
import { default as Compiler } from '../../../compiler';
|
|
4
|
-
import { default as Report } from '../../types/report';
|
|
5
|
-
export declare class DepInterpreter {
|
|
6
|
-
private compiler;
|
|
7
|
-
private metadata;
|
|
8
|
-
private declarationNode;
|
|
9
|
-
private filepath;
|
|
10
|
-
private dep;
|
|
11
|
-
constructor(compiler: Compiler, metadata: DepMetadata, filepath: Filepath);
|
|
12
|
-
interpret(): Report<Dep>;
|
|
13
|
-
private interpretName;
|
|
14
|
-
private interpretEdges;
|
|
15
|
-
/**
|
|
16
|
-
* Read settings into `dep.note` and `dep.custom`.
|
|
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 `custom` 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
|
-
private interpretSettings;
|
|
32
|
-
private consumeSettings;
|
|
33
|
-
private extractAttrValue;
|
|
34
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { default as Compiler } from '../../../compiler';
|
|
2
|
-
import { CompileError } from '../../types/errors';
|
|
3
|
-
import { BlockExpressionNode, ElementDeclarationNode, FunctionApplicationNode, ListExpressionNode } from '../../types/nodes';
|
|
4
|
-
import { default as Report } from '../../types/report';
|
|
5
|
-
import { Settings } from '../../utils/validate';
|
|
6
|
-
export default class DepValidator {
|
|
7
|
-
private declarationNode;
|
|
8
|
-
private compiler;
|
|
9
|
-
constructor(compiler: Compiler, declarationNode: ElementDeclarationNode);
|
|
10
|
-
validate(): CompileError[];
|
|
11
|
-
private validateContext;
|
|
12
|
-
private validateName;
|
|
13
|
-
private validateAlias;
|
|
14
|
-
validateBody(body?: FunctionApplicationNode | BlockExpressionNode): CompileError[];
|
|
15
|
-
validateFields(fields: FunctionApplicationNode[]): CompileError[];
|
|
16
|
-
private validateSubElements;
|
|
17
|
-
}
|
|
18
|
-
export declare function validateDepSettings(settings: ListExpressionNode): Report<Settings>;
|