@dbml/parse 9.0.0-optional-ref.10 → 9.0.0-optional-ref.12
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,19 +1,20 @@
|
|
|
1
1
|
type BaseRelationshipOp = '>' | '<' | '-' | '<>';
|
|
2
2
|
export type RelationshipOp = `${'?' | ''}${BaseRelationshipOp}${'?' | ''}`;
|
|
3
3
|
export type RelationCardinality = `${number}` | '*' | `${number}..${number | '*'}`;
|
|
4
|
-
export declare function normalizeCardinality(c: RelationCardinality): RelationCardinality;
|
|
5
4
|
export declare function parseCardinality(c: RelationCardinality): {
|
|
6
5
|
min: number;
|
|
7
6
|
max: number | '*';
|
|
8
7
|
};
|
|
9
|
-
export declare const RELATIONSHIP_OPS: ReadonlySet<RelationshipOp>;
|
|
10
8
|
export declare const CARDINALITY_ONE: RelationCardinality;
|
|
11
9
|
export declare const CARDINALITY_MAYBE: RelationCardinality;
|
|
12
10
|
export declare const CARDINALITY_SOME: RelationCardinality;
|
|
13
11
|
export declare const CARDINALITY_MANY: RelationCardinality;
|
|
12
|
+
export declare const RELATIONSHIP_OPS: ReadonlyMap<RelationshipOp, [RelationCardinality, RelationCardinality]>;
|
|
14
13
|
export declare function getMultiplicities(op: string): [RelationCardinality, RelationCardinality] | undefined;
|
|
15
14
|
export declare function isEndpointOneSide(relation: RelationCardinality): boolean;
|
|
16
15
|
export declare function isEndpointManySide(relation: RelationCardinality): boolean;
|
|
16
|
+
export declare function isEndpointOptional(relation: RelationCardinality): boolean;
|
|
17
|
+
export declare function isEndpointRequired(relation: RelationCardinality): boolean;
|
|
17
18
|
export declare function makeRelationshipRequired(op: RelationshipOp): BaseRelationshipOp;
|
|
18
19
|
export declare function getRelationshipOp(left: RelationCardinality, right: RelationCardinality): RelationshipOp;
|
|
19
20
|
export declare function makeCardinalityOptional(rel: RelationCardinality): RelationCardinality;
|
|
@@ -65,14 +65,6 @@ export declare class PartialRefMetadata extends NodeMetadata {
|
|
|
65
65
|
op(_compiler: Compiler): RelationshipOp | undefined;
|
|
66
66
|
opToken(): SyntaxToken | undefined;
|
|
67
67
|
cardinalities(compiler: Compiler): [RelationCardinality, RelationCardinality] | undefined;
|
|
68
|
-
leftCardinality(compiler: Compiler): {
|
|
69
|
-
min: number;
|
|
70
|
-
max: number | '*';
|
|
71
|
-
} | undefined;
|
|
72
|
-
rightCardinality(compiler: Compiler): {
|
|
73
|
-
min: number;
|
|
74
|
-
max: number | '*';
|
|
75
|
-
} | undefined;
|
|
76
68
|
leftToken(): SyntaxNode;
|
|
77
69
|
rightToken(): SyntaxNode;
|
|
78
70
|
owners(compiler: Compiler): NodeSymbol[];
|
|
@@ -147,7 +147,7 @@ export declare class ColumnSymbol extends NodeSymbol {
|
|
|
147
147
|
}, id: NodeSymbolId, filepath: Filepath);
|
|
148
148
|
get canBeImported(): boolean;
|
|
149
149
|
get originalSymbol(): NodeSymbol;
|
|
150
|
-
qualifiedName(compiler: Compiler): string;
|
|
150
|
+
qualifiedName(compiler: Compiler): string[];
|
|
151
151
|
pk(compiler: Compiler): boolean;
|
|
152
152
|
isUniqueSet(compiler: Compiler): boolean;
|
|
153
153
|
unique(compiler: Compiler): boolean;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -11,7 +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, makeCardinalityRequired, makeCardinalityOptional, makeRelationshipRequired, isEndpointOneSide, isEndpointManySide, CARDINALITY_ONE, CARDINALITY_MAYBE, CARDINALITY_SOME, CARDINALITY_MANY, } from './core/types/relation';
|
|
14
|
+
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';
|
|
15
15
|
export type { DiagramViewSyncOperation, DiagramViewBlock, TextEdit, } from './compiler/queries/transform';
|
|
16
16
|
export { dbmlLanguageConfig, dbmlMonarchTokensProvider, } from './services/monarch';
|
|
17
17
|
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": "9.0.0-optional-ref.
|
|
4
|
+
"version": "9.0.0-optional-ref.12",
|
|
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": "57741244adba234137bc9a3c0a841ad24351923b"
|
|
54
54
|
}
|