Synclets logoSynclets

getTableSchema

The getTableSchema function retrieves the schema of a table from a SQLite3 database, returning an object mapping column names to their data types.

getTableSchema(
  database: Database,
  table: string,
): Promise<TableSchema>
TypeDescription
databaseDatabase

The SQLite3 database instance.

tablestring

The name of the table to inspect.

returnsPromise<TableSchema>

A Promise that resolves to an object mapping column names to types.

This utility function provides a standardized way to inspect table structure across different database connectors, with consistent output format regardless of the underlying database engine.

Since

v0.0.0