Replies: 3 comments
-
You can do it like this: object value = 42;
_ = value switch
{
bool val => row.AppendValue(val),
int val => row.AppendValue(val),
long val => row.AppendValue(val),
}; |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks. I suppose I need to include all .net data types, as in https://duckdb.net/docs/type-mapping.html I wonder if there is a way to not evaluate object type, in switch condition, for every row, as a table column type is always the same. |
Beta Was this translation helpful? Give feedback.
0 replies
-
You can probably create a static |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
My question is how to use DuckDBAppender retrieving data from a generic table of database server with a datareader, without knowing at compile time field types. Is there any example or documentation?
mytable must be created, retrieving data types from myserverdatareader and converting them to the specific DuckDB type.
Thanks for your help!
Beta Was this translation helpful? Give feedback.
All reactions