Synclets logoSynclets

getTableSchema

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

getTableSchema(
  pglite: PGlite,
  table: string,
): Promise<TableSchema>
TypeDescription
pglitePGlite

The PGlite 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