interface
SQL.ResultColumn
interface ResultColumn
A column of a PostgreSQL or MySQL result, as the server described it
const result = await sql`SELECT id, data FROM posts`;
console.log(result.columns);
// PostgreSQL:
// [
// { name: "id", type: 23, table: 16388, number: 1 }, // int4
// { name: "data", type: 3802, table: 16388, number: 2 }, // jsonb
// ]- number?: number
PostgreSQL only. The number of the column in its table, from
1.0for an expression, negative for a system column such asctid. - table: string | number
The table that the column comes from.
- PostgreSQL: the OID of the table.
0for an expression. - MySQL: the name of the table, or its alias in the query.
""for an expression.
- PostgreSQL: the OID of the table.
- type: number
The type of the column.
- PostgreSQL: the OID of the type, such as
23forint4,25fortext,1009fortext[],3802forjsonb - MySQL: the type code of the protocol, such as
3forINT,8forBIGINT,253forVARCHAR,245forJSON
- PostgreSQL: the OID of the type, such as