Base Classes

All the base TypeScript classes in an ORM file that represent a table or view extend the base class EntityBase. Similarly, all the base TypeScript classes that represent a stored procedure extend ProcedureBase.

Importing

These files can be imported from wire-orm-base.ts.

ORM structures can be imported individually from an ORM file.

import { Categories } from "./northwind.orm.js";

const categories = await Categories.select().execAsync();

All structures in an ORM file can also be imported at one time using the * syntax. In the example below, the Northwind variable acts as a namespace for all of the structures in the ORM file. Any reference to a structure in the file will start with Northwind.

import * as Northwind from "./northwind.orm.js";

const categories = await Northwind.Categories.select().execAsync();

Last updated