pg-mermaid
Version:
Mermaid diagram generator for PostgreSQL database schema
28 lines • 1.02 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TableIndexesSchema = exports.RelationshipSchema = exports.EntitySchema = void 0;
const zod_1 = require("zod");
exports.EntitySchema = zod_1.z.object({
attributes: zod_1.z.array(zod_1.z.object({
comment: zod_1.z.union([zod_1.z.literal('not null'), zod_1.z.literal('null')]),
key: zod_1.z.union([zod_1.z.literal('PK'), zod_1.z.literal('FK')]).nullable(),
name: zod_1.z.string(),
type: zod_1.z.string(),
})),
name: zod_1.z.string(),
});
exports.RelationshipSchema = zod_1.z.object({
child: zod_1.z.object({
attributes: zod_1.z.array(zod_1.z.string()),
entity: zod_1.z.string(),
}),
parent: zod_1.z.object({
attributes: zod_1.z.array(zod_1.z.string()),
entity: zod_1.z.string(),
}),
});
exports.TableIndexesSchema = zod_1.z.object({
indexes: zod_1.z.array(zod_1.z.string()),
name: zod_1.z.string(),
});
//# sourceMappingURL=types.js.map