getTableSchema
The getTableSchema function retrieves the schema of a table from a Cloudflare Durable Object SQL Storage, returning an object mapping column names to their data types.
getTableSchema(
sqlStorage: SqlStorage,
table: string,
): Promise<TableSchema>| Type | Description | |
|---|---|---|
sqlStorage | SqlStorage | The Durable Object SQL Storage instance. |
table | string | The name of the table to inspect. |
| returns | Promise<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.7