oven-sh/bun

Getting column-type information from a statement/query

已关闭

#7,134 创建于 2023年11月15日

 (4 条评论) (0 个反应) (1 位负责人)Rust (4,486 个派生)batch import
bun.jsbun:sqliteenhancementgood first issue

仓库指标

星标
 (90,348 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

What is the problem this feature would solve?

I would like more information about the columns the will be returned from a statement, right now I can only get the columnName but more info like the one we can get from better-sqlite would be nice.

Stolen from their docs:

.name: the name (or alias) of the result column.
.column: the name of the originating table column, or null if it's an expression or subquery.
.table: the name of the originating table, or null if it's an expression or subquery.
.database: the name of the originating database, or null if it's an expression or subquery.
.type: the name of the [declared type](https://www.sqlite.org/datatype3.html#determination_of_column_affinity), or null if it's an expression or subquery.

https://github.com/WiseLibs/better-sqlite3/blob/HEAD/docs/api.md#columns---array-of-objects

What is the feature you are proposing to solve the problem?

We are wanna do some automagic formatting of the result based the column type. And yes, I'm aware there is only like 5 datatypes and that they can be mixed.

What alternatives have you considered?

Using better-sqlite3 instead of buns built in variant.

https://github.com/WiseLibs/better-sqlite3/blob/HEAD/docs/api.md#columns---array-of-objects

贡献者指南