Can't find JSON appender #344
-
|
In the appender methods, I can't find a JSON appender. I guess using Varchar is fine, but is it the way to go ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Since the JSON type is just VARCHAR with an alias, you should be able to use the VARCHAR method. Or, if you append a data chunk, you can create the chunk with a JSON-typed column. (Again, the JSON type is just a VARCHAR with an alias, which you can construct using |
Beta Was this translation helpful? Give feedback.
Since the JSON type is just VARCHAR with an alias, you should be able to use the VARCHAR method.
Or, if you append a data chunk, you can create the chunk with a JSON-typed column. (Again, the JSON type is just a VARCHAR with an alias, which you can construct using
DuckDBVarCharType.create('JSON').) I'd recommend appending using data chunks for all but the simplest scenarios, because the type support is complete and it's also more efficient.