Skip to content

Binding StringIO not supported #920

@pere73

Description

@pere73

It would be great if you can also bind StringIO-objects, so that this code is possible:

require 'duckdb'
require 'stringio'

db = DuckDB::Database.open

csv_data = "id,name,age\n1,Alice,30\n2,Bob,25\n3,Charlie,35"
csv_io = StringIO.new(csv_data)

db.connect do |con|
  con.query("CREATE TABLE test AS SELECT * FROM read_csv_auto(?, header = true)", csv_io)
end

At the moment it leads to the error:

... /3.3.0/gems/duckdb-1.2.0.0/lib/duckdb/prepared_statement.rb:288:in `bind_with_index': not supported type `#<StringIO:0x000001f1ceba5380>` (StringIO) (DuckDB::Error)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions