Skip to content

Information schema

ArteMerlow edited this page May 28, 2025 · 1 revision

Information schema

The library also supports working with INFORMATION_SCHEMA.TABLES and INFORMATION_SCHEMA.COLUMNS. Interaction with tables is done through the InformationSchema class, and with columns — through the InformationSchemaColumns.

// If TABLE_SCHEMA and TABLE_NAME are provided, a ANALIZE TABLE query is automatically executed
const results : InformationSchemaResult[] = InformationSchema.select({
    TABLE_SCHEMA: `ur_database_name`,
    TABLE_NAME: `ur_table_name` // As string only
})

if (results.length < 1) return;
const nextAutoincrementID = results[0].autoIncrement;

Clone this wiki locally