Skip to content

Support nil as a query's input argument #136

@vovayartsev-dice

Description

@vovayartsev-dice

Reproducible in adbc v0.7.9

This works fine

Adbc.Connection.query(conn, "SELECT $1 as name", ["Alice"])

This fails

Adbc.Connection.query(conn, "SELECT $1 as name", [nil])
# => {:error, #Adbc.Error<message: "nanoarrow call failed: PostgresType::FromSchema(type_resolver, bind_schema->children[i], &type, &na_error) = (95) Operation not supported. Can't map Arrow type 'na' to Postgres type", vendor_code: 0, ...>}

Use-case

Similar to https://arrow.apache.org/adbc/main/python/recipe/postgresql.html#loading-csv-files-into-postgresql
I actually was trying to perform INSERT INTO table (col1, col2) VALUES ($1, $2) but my dataset contains nils.

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