29 lines
724 B
TypeScript
29 lines
724 B
TypeScript
import sqlite from "better-sqlite3";
|
|
|
|
import {
|
|
lotOccupancyDB as databasePath
|
|
} from "../../data/databasePaths.js";
|
|
|
|
import type * as recordTypes from "../../types/recordTypes";
|
|
|
|
|
|
export const getLotOccupantTypes = (): recordTypes.LotOccupantType[] => {
|
|
|
|
const database = sqlite(databasePath, {
|
|
readonly: true
|
|
});
|
|
|
|
const lotOccupantTypes: recordTypes.LotOccupantType[] = database
|
|
.prepare("select lotOccupantTypeId, lotOccupantType" +
|
|
" from LotOccupantTypes" +
|
|
" where recordDelete_timeMillis is null" +
|
|
" order by orderNumber, lotOccupantType")
|
|
.all();
|
|
|
|
database.close();
|
|
|
|
return lotOccupantTypes;
|
|
};
|
|
|
|
|
|
export default getLotOccupantTypes; |