add typescript type inference

This commit is contained in:
Daniel Roth 2026-01-27 09:57:43 +00:00
parent 4cd80cea71
commit c35b53d186
3 changed files with 8 additions and 1 deletions

View file

@ -32,4 +32,6 @@ export const aspectType = pgEnum("aspect_type", [
"construction_type",
"classification",
"system",
]);
]);
export type AspectType = typeof aspectType.enumValues[number];

View file

@ -9,6 +9,7 @@ import {
} from "drizzle-orm/pg-core";
import { element } from "./element";
import { aspectType } from "./aspect_type";
import { InferSelectModel } from "drizzle-orm";
export const assetCondition = pgTable(
@ -35,3 +36,5 @@ export const assetCondition = pgTable(
.on(t.uprn, t.element, t.aspectType, t.elementInstance),
]
);
export type AssetConditionRow = InferSelectModel<typeof assetCondition>;

View file

@ -202,3 +202,5 @@ export const element = pgEnum("element", [
"hhsrs_structural_collapse",
"hhsrs_amenities",
]);
export type Element = typeof element.enumValues[number];