Documentation / @zerotal/orm / index / SchemaInspector
Variable: SchemaInspector
constSchemaInspector:object
Defined in: packages/orm/src/schema/SchemaInspector.ts:42
Queries the live database to enumerate tables and their column definitions.
Used by migrate:generate to compute what has changed since the last migration.
Type Declaration
tables()
tables():
Promise<string[]>
Return all user-defined table names in the current DB.
Returns
Promise<string[]>
columns()
columns(
table):Promise<LiveColumn[] |null>
Return column details for a single table, or null if the table doesn't exist. Table name is sanitised before use — safe against injection even for SQLite PRAGMAs.
Parameters
table
string
Returns
Promise<LiveColumn[] | null>
describe()
describe(
table):Promise<LiveTable|null>
Return a fully described LiveTable, or null if the table doesn't exist.
Parameters
table
string
Returns
Promise<LiveTable | null>