@tsofist/schema-forge 2.7.0 → 2.8.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/lib/types/db.types.d.ts +7 -0
- package/lib/validator.js +1 -0
- package/package.json +1 -1
package/lib/types/db.types.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ export declare const DBIndexTypeList: readonly ["btree", "hash", "gin", "gist",
|
|
|
14
14
|
export type DBIndexType = (typeof DBIndexTypeList)[number];
|
|
15
15
|
/**
|
|
16
16
|
* Database index options.
|
|
17
|
+
*
|
|
18
|
+
* @see https://dbml.dbdiagram.io/docs/#index-definition dbml spec
|
|
17
19
|
*/
|
|
18
20
|
export type DBIndexOptions = {
|
|
19
21
|
/**
|
|
@@ -31,6 +33,11 @@ export type DBIndexOptions = {
|
|
|
31
33
|
* @default false
|
|
32
34
|
*/
|
|
33
35
|
unique?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Is it a primary key
|
|
38
|
+
* @default false
|
|
39
|
+
*/
|
|
40
|
+
pk?: boolean;
|
|
34
41
|
};
|
|
35
42
|
export type DBIndexOptionsDef<B extends boolean = boolean> = ArrayMay<DBIndexOptions | string | B>;
|
|
36
43
|
/**
|
package/lib/validator.js
CHANGED
|
@@ -334,6 +334,7 @@ function addJSDocKeywords(engine) {
|
|
|
334
334
|
const DBIndexOptionsProperties = {
|
|
335
335
|
name: { type: 'string', pattern: IXNamePattern },
|
|
336
336
|
unique: { type: 'boolean' },
|
|
337
|
+
pk: { type: 'boolean' },
|
|
337
338
|
type: {
|
|
338
339
|
type: 'string',
|
|
339
340
|
enum: db_types_1.DBIndexTypeList,
|