@dbml/parse 9.0.0-optional-ref.3 → 9.0.0-optional-ref.6
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/dist/dbml-parse.js +19 -19
- package/dist/dbml-parse.mjs +3960 -3973
- package/dist/src/core/global_modules/program/interpret.d.ts +1 -1
- package/dist/src/core/types/errors.d.ts +2 -5
- package/dist/src/core/types/report.d.ts +4 -4
- package/dist/src/core/types/schemaJson/index.d.ts +0 -1
- package/dist/src/core/types/symbol/symbols.d.ts +1 -0
- package/dist/src/index.d.ts +1 -2
- package/dist/src/services/diagnostics/provider.d.ts +3 -5
- package/package.json +2 -2
- package/dist/src/core/types/schemaJson/utils.d.ts +0 -3
|
@@ -10,7 +10,7 @@ export default class ProgramInterpreter {
|
|
|
10
10
|
private filepath;
|
|
11
11
|
private errors;
|
|
12
12
|
private warnings;
|
|
13
|
-
private
|
|
13
|
+
private infos;
|
|
14
14
|
private db;
|
|
15
15
|
constructor(compiler: Compiler, symbol: ProgramSymbol, filepath: Filepath);
|
|
16
16
|
interpret(): Report<SchemaElement | SchemaElement[] | undefined>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TextEdit } from '../../compiler';
|
|
1
2
|
import { Filepath } from './filepath';
|
|
2
3
|
import { SyntaxNode } from './nodes';
|
|
3
4
|
import { SyntaxToken } from './tokens';
|
|
@@ -125,7 +126,6 @@ export declare class CompileError extends Error {
|
|
|
125
126
|
nodeOrToken: Readonly<SyntaxNode | SyntaxToken>;
|
|
126
127
|
start: Readonly<number>;
|
|
127
128
|
end: Readonly<number>;
|
|
128
|
-
relatedLocations?: RelatedLocation[];
|
|
129
129
|
constructor(code: number, message: string, nodeOrToken: SyntaxNode | SyntaxToken);
|
|
130
130
|
toWarning(): CompileWarning;
|
|
131
131
|
get filepath(): Filepath;
|
|
@@ -136,14 +136,13 @@ export declare class CompileWarning extends Error {
|
|
|
136
136
|
nodeOrToken: Readonly<SyntaxNode | SyntaxToken>;
|
|
137
137
|
start: Readonly<number>;
|
|
138
138
|
end: Readonly<number>;
|
|
139
|
-
relatedLocations?: RelatedLocation[];
|
|
140
139
|
constructor(code: number, message: string, nodeOrToken: SyntaxNode | SyntaxToken);
|
|
141
140
|
get filepath(): Filepath;
|
|
142
141
|
}
|
|
143
142
|
export interface QuickFix {
|
|
144
143
|
title: string;
|
|
145
144
|
filepath: Filepath;
|
|
146
|
-
edits:
|
|
145
|
+
edits: TextEdit[];
|
|
147
146
|
}
|
|
148
147
|
export declare class CompileInfo extends Error {
|
|
149
148
|
code: Readonly<CompileErrorCode>;
|
|
@@ -152,10 +151,8 @@ export declare class CompileInfo extends Error {
|
|
|
152
151
|
start: Readonly<number>;
|
|
153
152
|
end: Readonly<number>;
|
|
154
153
|
quickFixes?: QuickFix[];
|
|
155
|
-
relatedLocations?: RelatedLocation[];
|
|
156
154
|
constructor(code: number, message: string, nodeOrToken: SyntaxNode | SyntaxToken, options?: {
|
|
157
155
|
quickFixes?: QuickFix[];
|
|
158
|
-
relatedLocations?: RelatedLocation[];
|
|
159
156
|
});
|
|
160
157
|
get filepath(): Filepath;
|
|
161
158
|
}
|
|
@@ -3,16 +3,16 @@ export default class Report<T> {
|
|
|
3
3
|
private value;
|
|
4
4
|
private errors;
|
|
5
5
|
private warnings?;
|
|
6
|
-
private
|
|
7
|
-
static create<T>(value: T, errors?: CompileError[], warnings?: CompileWarning[],
|
|
8
|
-
constructor(value: T, errors?: CompileError[], warnings?: CompileWarning[],
|
|
6
|
+
private infos?;
|
|
7
|
+
static create<T>(value: T, errors?: CompileError[], warnings?: CompileWarning[], infos?: CompileInfo[]): Report<T>;
|
|
8
|
+
constructor(value: T, errors?: CompileError[], warnings?: CompileWarning[], infos?: CompileInfo[]);
|
|
9
9
|
filter<S extends symbol>(filteredValue: S): Report<undefined | Exclude<T, S>>;
|
|
10
10
|
hasValue<S>(value: S): this is Report<S>;
|
|
11
11
|
getFiltered<S extends symbol | undefined | null>(filteredValue: S): Exclude<T, S> | undefined;
|
|
12
12
|
getValue(): T;
|
|
13
13
|
getErrors(): CompileError[];
|
|
14
14
|
getWarnings(): CompileWarning[];
|
|
15
|
-
|
|
15
|
+
getInfos(): CompileInfo[];
|
|
16
16
|
chainFiltered<S extends symbol | undefined | null, U>(fn: (_: Exclude<T, S>) => Report<U>, filteredValue: S): Report<U | undefined>;
|
|
17
17
|
chain<U>(fn: (_: T) => Report<U>): Report<U>;
|
|
18
18
|
mapFiltered<S extends symbol | undefined | null, U>(fn: (_: Exclude<T, S>) => U, filteredValue: S): Report<U | undefined>;
|
|
@@ -149,6 +149,7 @@ export declare class ColumnSymbol extends NodeSymbol {
|
|
|
149
149
|
get originalSymbol(): NodeSymbol;
|
|
150
150
|
qualifiedName(compiler: Compiler): string;
|
|
151
151
|
pk(compiler: Compiler): boolean;
|
|
152
|
+
isUniqueSet(compiler: Compiler): boolean;
|
|
152
153
|
unique(compiler: Compiler): boolean;
|
|
153
154
|
nullable(compiler: Compiler): boolean;
|
|
154
155
|
isNotNullSet(compiler: Compiler): boolean | undefined;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -11,8 +11,7 @@ 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
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';
|
|
15
|
-
export { inferMultiplicitiesFromColumns } from './core/types/schemaJson';
|
|
14
|
+
export { type RelationCardinality, type RelationshipOp, getRelationshipOp, getMultiplicities, parseCardinality, makeCardinalityRequired, makeCardinalityOptional, CARDINALITY_ONE, CARDINALITY_MAYBE, CARDINALITY_SOME, CARDINALITY_MANY, } from './core/types/relation';
|
|
16
15
|
export type { DiagramViewSyncOperation, DiagramViewBlock, TextEdit, } from './compiler/queries/transform';
|
|
17
16
|
export { dbmlLanguageConfig, dbmlMonarchTokensProvider, } from './services/monarch';
|
|
18
17
|
export * from './compiler/projectLayout/layout';
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { default as Compiler } from '../../compiler';
|
|
2
2
|
import { Filepath } from '../../core/types/filepath';
|
|
3
|
-
import { RelatedLocation } from '../../core/types/errors';
|
|
4
3
|
import { MarkerData } from '../types';
|
|
5
4
|
export interface Diagnostic {
|
|
6
|
-
type: 'error' | 'warning' | '
|
|
5
|
+
type: 'error' | 'warning' | 'info';
|
|
7
6
|
text: string;
|
|
8
7
|
startRow: number;
|
|
9
8
|
startColumn: number;
|
|
@@ -11,7 +10,6 @@ export interface Diagnostic {
|
|
|
11
10
|
endColumn: number;
|
|
12
11
|
code?: string | number;
|
|
13
12
|
filepath: Filepath;
|
|
14
|
-
relatedLocations?: RelatedLocation[];
|
|
15
13
|
}
|
|
16
14
|
export default class DBMLDiagnosticsProvider {
|
|
17
15
|
private compiler;
|
|
@@ -29,9 +27,9 @@ export default class DBMLDiagnosticsProvider {
|
|
|
29
27
|
*/
|
|
30
28
|
provideWarnings(filepath?: Filepath): Diagnostic[];
|
|
31
29
|
/**
|
|
32
|
-
* Get only
|
|
30
|
+
* Get only infos from the current compilation
|
|
33
31
|
*/
|
|
34
|
-
|
|
32
|
+
provideInfos(filepath?: Filepath): Diagnostic[];
|
|
35
33
|
/**
|
|
36
34
|
* Convert Monaco markers format (for editor integration)
|
|
37
35
|
*/
|
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-optional-ref.
|
|
4
|
+
"version": "9.0.0-optional-ref.6",
|
|
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": "9d8aa4b58c6ceae262252ea590e05e3e966c10e6"
|
|
54
54
|
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { Column } from './types';
|
|
2
|
-
import { RelationCardinality } from '../relation';
|
|
3
|
-
export declare function inferMultiplicitiesFromColumns(sourceColumn: Pick<Column, 'pk' | 'unique' | 'not_null'>, targetColumn: Pick<Column, 'pk' | 'unique' | 'not_null'>): [RelationCardinality, RelationCardinality];
|