adbc icon indicating copy to clipboard operation
adbc copied to clipboard

List Parameter for Query

Open maennchen opened this issue 1 year ago • 2 comments

The following code is not currently supported:

Adbc.Connection.query(
  connection_pid,
  """
  SELECT *
  FROM posts
  WHERE id = ANY(?1::INT[])
  """,
  [[1, 2]]
)

=>

{:error, %ArgumentError{message: "type not supported yet."}

maennchen avatar Nov 14 '23 09:11 maennchen

Yes, we don't support list types yet. PRs are welcome. :)

josevalim avatar Nov 14 '23 09:11 josevalim

I tried to take a quick stab at it, but have some issues:

  • SQLite does not really support arrays except in JSON. I therefore wanted to try with Postgres
  • Postgres array responses are not working: #40
  • Adbc seems not to support parameters with Postgres select at all

https://arrow.apache.org/adbc/0.5.1/python/recipe/postgresql.html#execute-a-statement-with-bind-parameters

Right now, the PostgreSQL driver only supports bind parameters for queries that don’t generate result sets.

maennchen avatar Nov 14 '23 11:11 maennchen

This is implemented I believe. Both PG support and arrow lists.

josevalim avatar Nov 12 '24 11:11 josevalim