Skip to content

feature request: allow to pass Vec<i64> to rarray #1602

Description

@davemilter

I have set of primary keys prepared for SQL request:

let mut ids: Vec<i64> = ...;
ids.sort_unstable();
ids.dedup();

it would be nice if I can pass Vec<i64> directly to Statement::query_and_then:

let mut stmt = conn.prepare(&format!("SELECT {all_sql_fields} FROM {tbl_name} WHERE id_key IN rarray(?)"))?;
 stmt.query_and_then([ids], ...)?;

for now I have to make two allocation and copy ids to Vec<Value> to pass ids to Statement::query_and_then:

    let ids = Rc::new(ids.into_iter().map(Value::from).collect::<Vec<Value>>());

But for example carray allow to pass array of i64 directly without any reallocation.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions