Skip to content

Add Decimal support for bind_parameter #619

@PeterlitsZo

Description

@PeterlitsZo

I find there is code like:

fn bind_parameter<P: ?Sized + ToSql>(&self, param: &P, col: usize) -> Result<()> {
    let value = param.to_sql()?;

    let ptr = unsafe { self.stmt.ptr() };
    let value = match value {
        ToSqlOutput::Borrowed(v) => v,
        ToSqlOutput::Owned(ref v) => ValueRef::from(v),
    };
    // TODO: bind more
    let rc = match value {
        //
        // Some code...
        //
        _ => unreachable!("not supported: {}", value.data_type()),
    };
    result_from_duckdb_prepare(rc, ptr)
}

And I find we do not deal with the Decimal, and then panic like:

internal error: entered unreachable code: not supported: Decimal

Can I send you a PR to deal with it?

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