TypeScript ORM
  • Introduction
  • Installation
  • Base Classes
  • Tables and Views
    • Select
    • Insert/Update
    • Delete
    • toQuery
    • toDataSet
  • Stored Procedures
    • Execute
    • toProcedure
    • toDataSet
Powered by GitBook
On this page

Base Classes

PreviousInstallationNextTables and Views

Last updated 1 year ago

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

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();
EntityBase
ProcedureBase