Skip to content

[Feature] support .raw({columnNames: true}) for D1PreparedStatement #1052

Description

@hydrogen602

Is there an existing issue for this?

  • I have searched the existing issues

Description

So there currently are bindings for calling .raw() on a prepared statement.

#[wasm_bindgen(structural, method, catch, js_class=D1PreparedStatement, js_name=raw)]
pub fn raw(this: &D1PreparedStatement) -> Result<Promise, JsValue>;

However, the option to fetch column names too via .raw({columnNames: true}) is not supported right now.

https://developers.cloudflare.com/d1/worker-api/prepared-statements/#raw

It would be great for writing interfaces to existing ORMs like diesel.

I'm currently forking & updating an old diesel-d1 codebase I found (fork: https://github.com/hydrogen602/diesel-d1) and diesel indexes into a row via an usize so returning arrays of arrays are perfect for that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions