marcboeker / go-duckdb

go-duckdb provides a database/sql driver for the DuckDB database engine.
MIT License
623 stars 97 forks source link

appender: add sql null types #156

Closed scottlepp closed 6 months ago

marcboeker commented 6 months ago

Thanks for the PR @scottlepp. In PR #150 a complete refactoring of the Appender is introduced, which will probably beak your PR. I suggest that you check your modifications again, when #150 has been merged (probably this week).

scottlepp commented 6 months ago

Hi @marcboeker. I'm using that fork now. That allows appending nil values. Though the first value in the vector can't be null. I'm assuming that is because it needs a value to determine the datatype for the vector. I have a workaround but does that sound right?

maiadegraaf commented 6 months ago

@scottlepp Yes exactly, the first row is used to initialize the types, and because if the user tries to append the first row like this:


err = appender.AppendRow(
        nil,
    )

there is no way to derive the type so it can't be properly initialized.