@dbml/parse 9.0.0-alpha.1 → 9.0.0-alpha.10
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 +18 -14
- package/dist/dbml-parse.mjs +2568 -2021
- package/dist/index.d.ts +0 -0
- package/dist/src/compiler/index.d.ts +9 -6
- 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 +3 -1
- package/dist/src/compiler/queries/transform/renameTable.d.ts +2 -2
- package/dist/src/compiler/queries/transform/syncDep.d.ts +60 -0
- package/dist/src/compiler/queries/transform/syncDiagramView.d.ts +0 -0
- package/dist/src/compiler/queries/transform/types.d.ts +48 -0
- package/dist/src/compiler/queries/transform/updateElementSetting.d.ts +4 -0
- package/dist/src/compiler/queries/transform/utils.d.ts +8 -10
- package/dist/src/compiler/queries/utils.d.ts +5 -0
- package/dist/src/compiler/types.d.ts +8 -7
- 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/dep/bind.d.ts +0 -0
- package/dist/src/core/global_modules/dep/index.d.ts +0 -0
- package/dist/src/core/global_modules/dep/interpret.d.ts +2 -2
- 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 -0
- package/dist/src/core/global_modules/ref/interpret.d.ts +0 -0
- package/dist/src/core/global_modules/schema/index.d.ts +0 -0
- package/dist/src/core/global_modules/table/bind.d.ts +0 -0
- 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 -0
- 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/dep/index.d.ts +0 -0
- package/dist/src/core/local_modules/dep/validate.d.ts +1 -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 +4 -3
- 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 -0
- 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/report.d.ts +0 -0
- package/dist/src/core/types/schemaJson.d.ts +6 -2
- 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 +0 -0
- 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 +2 -1
- package/dist/src/core/utils/interpret.d.ts +0 -0
- package/dist/src/core/utils/note.d.ts +18 -0
- package/dist/src/core/utils/numbers.d.ts +0 -0
- package/dist/src/core/utils/setting.d.ts +16 -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 +4 -0
- 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
|
@@ -177,11 +177,12 @@ export interface Dep {
|
|
|
177
177
|
schemaName: string | null;
|
|
178
178
|
name: string | null;
|
|
179
179
|
edges: DepEdge[];
|
|
180
|
+
color?: Color;
|
|
180
181
|
note?: {
|
|
181
182
|
value: string;
|
|
182
183
|
token: TokenPosition;
|
|
183
184
|
};
|
|
184
|
-
|
|
185
|
+
metadata?: Record<string, string | number | boolean | null>;
|
|
185
186
|
token: TokenPosition;
|
|
186
187
|
}
|
|
187
188
|
export interface DepEdge {
|
|
@@ -195,11 +196,14 @@ export interface DepEndpoint {
|
|
|
195
196
|
fieldNames: string[];
|
|
196
197
|
token: TokenPosition;
|
|
197
198
|
}
|
|
199
|
+
export declare const DEP_DOWNSTREAM: "->";
|
|
200
|
+
export declare const DEP_UPSTREAM: "<-";
|
|
201
|
+
export type DepDirection = typeof DEP_DOWNSTREAM | typeof DEP_UPSTREAM;
|
|
198
202
|
export interface InlineDep {
|
|
199
203
|
schemaName: string | null;
|
|
200
204
|
tableName: string;
|
|
201
205
|
fieldNames: string[];
|
|
202
|
-
direction:
|
|
206
|
+
direction: DepDirection;
|
|
203
207
|
token: TokenPosition;
|
|
204
208
|
}
|
|
205
209
|
export interface Enum {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ElementDeclarationNode, FunctionApplicationNode, FunctionExpressionNode, IdentifierStreamNode, PrimaryExpressionNode, SyntaxNode, TupleExpressionNode, VariableNode } from '../types/nodes';
|
|
1
|
+
import { AttributeNode, ElementDeclarationNode, FunctionApplicationNode, FunctionExpressionNode, IdentifierStreamNode, PrimaryExpressionNode, SyntaxNode, TupleExpressionNode, VariableNode } from '../types/nodes';
|
|
2
2
|
import { SyntaxToken } from '../types/tokens';
|
|
3
3
|
export declare function extractVariableNode(value?: unknown): SyntaxToken | undefined;
|
|
4
4
|
export declare function extractStringFromIdentifierStream(stream?: IdentifierStreamNode): string | undefined;
|
|
@@ -35,3 +35,4 @@ export declare function extractVariableFromExpression(node?: SyntaxNode): string
|
|
|
35
35
|
export declare function extractVarNameFromPrimaryVariable(node?: PrimaryExpressionNode & {
|
|
36
36
|
expression: VariableNode;
|
|
37
37
|
}): string | undefined;
|
|
38
|
+
export declare function extractSettingName(attr: AttributeNode): string | undefined;
|
|
File without changes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SyntaxNode } from '../types/nodes';
|
|
2
|
+
import { TextEdit } from '../../compiler/queries/transform/applyTextEdits';
|
|
3
|
+
/**
|
|
4
|
+
* Produces a TextEdit that updates an existing note's value.
|
|
5
|
+
* Returns undefined if no note exists.
|
|
6
|
+
*/
|
|
7
|
+
export declare function updateNoteEdit(declaration: SyntaxNode, newValue: string): TextEdit | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* Produces a TextEdit that removes an existing note.
|
|
10
|
+
* Returns undefined if no note exists.
|
|
11
|
+
*/
|
|
12
|
+
export declare function removeNoteEdit(declaration: SyntaxNode): TextEdit | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Produces a TextEdit that adds a note to an element.
|
|
15
|
+
* Prioritizes body note form for block elements, falls back to setting attribute.
|
|
16
|
+
* Returns undefined if a note already exists.
|
|
17
|
+
*/
|
|
18
|
+
export declare function addNoteEdit(declaration: SyntaxNode, value: string): TextEdit | undefined;
|
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ListExpressionNode, AttributeNode, ElementDeclarationNode, SyntaxNode } from '../types/nodes';
|
|
2
|
+
import { TextEdit } from '../../compiler/queries/transform/applyTextEdits';
|
|
3
|
+
export type SettingLocation = {
|
|
4
|
+
kind: 'attribute';
|
|
5
|
+
settingsList: ListExpressionNode;
|
|
6
|
+
settingNode: AttributeNode;
|
|
7
|
+
settingIndex: number;
|
|
8
|
+
} | {
|
|
9
|
+
kind: 'body';
|
|
10
|
+
declaration: ElementDeclarationNode;
|
|
11
|
+
} | undefined;
|
|
12
|
+
export declare function findSetting(declaration: SyntaxNode, settingName: string): SettingLocation;
|
|
13
|
+
export declare function addSettingEdit(declaration: SyntaxNode, setting: string): TextEdit | undefined;
|
|
14
|
+
export declare function updateSettingEdit(declaration: SyntaxNode, settingName: string, value: string | null | undefined, source: string): TextEdit | undefined;
|
|
15
|
+
export declare function removeSettingEdit(declaration: SyntaxNode, settingName: string, source: string): TextEdit | undefined;
|
|
16
|
+
export declare function findBodySetting(declaration: ElementDeclarationNode, settingName: string): ElementDeclarationNode | undefined;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/src/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export { Filepath } from './core/types/filepath';
|
|
|
4
4
|
export { UNHANDLED, type Unhandled, } from './core/types/module';
|
|
5
5
|
export { ElementKind } from './core/types/keywords';
|
|
6
6
|
export { type NodeSymbol, SymbolKind, } from './core/types/symbol';
|
|
7
|
+
export { MetadataKind } from './core/types/symbol/metadata';
|
|
7
8
|
export * from './core/global_modules/records/utils';
|
|
8
9
|
export * from './core/types/nodes';
|
|
9
10
|
export { SyntaxToken, SyntaxTokenKind, isTriviaToken, isOp, isOpToken, } from './core/types/tokens';
|
|
@@ -12,6 +13,9 @@ export type { Position, } from './core/types';
|
|
|
12
13
|
export { ScopeKind, splitQualifiedIdentifier, unescapeString, escapeString, formatRecordValue, isValidIdentifier, addDoubleQuoteIfNeeded, } from './compiler/index';
|
|
13
14
|
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 RelationCardinality, 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
15
|
export type { DiagramViewSyncOperation, DiagramViewBlock, TextEdit, } from './compiler/queries/transform';
|
|
16
|
+
export { findDiagramViewBlocks, findDepBlocks } from './compiler/queries/transform';
|
|
17
|
+
export type { DepSyncOperation, DepSyncEdge, DepEndpointRef, DepBlock, } from './compiler/queries/transform';
|
|
18
|
+
export type { ElementIdentifier, SchemaIdentifier, TableIdentifier, ColumnIdentifier, EnumIdentifier, EndpointRef, RefIdentifier, DepIdentifier, NoteIdentifier, TableGroupIdentifier, } from './compiler/queries/transform';
|
|
15
19
|
export { dbmlLanguageConfig, dbmlMonarchTokensProvider, } from './services/monarch';
|
|
16
20
|
export * from './compiler/projectLayout/layout';
|
|
17
21
|
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-alpha.
|
|
4
|
+
"version": "9.0.0-alpha.10",
|
|
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": "73ddff600b762911ed681069ed73f5e1f74448c5"
|
|
54
54
|
}
|