interface

SQL.ColumnTransform

interface ColumnTransform

The two directions of Transform.column

  • from?: (name: string) => string

    Renames a column that comes from the database: the keys of the row objects, and name in ResultMetadata.columns.

    Bun calls it once for each column of a statement, not once for each row, so it must return the same name every time.

  • to?: (name: string) => string

    Renames a name that goes to the database: the keys of sql(object), the columns picked in sql(object, "a", "b"), and every sql("name"), table names included.