You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Result data can be converted to JSON-serializable JS objects using any of the variants of get...Json (e.g. getRowObjectsJson).
However, it would be useful to be able to specify custom conversions. This is already somewhat supported at the chunk level through the various convert... methods and the DuckDBValueConverter interface (and indeed this is what the get...Json methods use). But it would be more convenient to have top-level methods on DuckDBResult and DuckDBResultReader to get data using a custom converter.
Additionally, it would be helpful to be able to specify custom conversion by starting from an existing, library-supplied converter and only specifying the (usually few) differences desired.
One example of doing this is the pg-promise API:
function setPgParserTypes() {
// see https://stackoverflow.com/questions/39168501/pg-promise-returns-integers-as-strings
pgp().pg.types.setTypeParser(TypeId.INT8, parseInt);
pgp().pg.types.setTypeParser(TypeId.FLOAT8, parseFloat);
pgp().pg.types.setTypeParser(TypeId.NUMERIC, parseFloat);
}
Result data can be converted to JSON-serializable JS objects using any of the variants of
get...Json
(e.g.getRowObjectsJson
).However, it would be useful to be able to specify custom conversions. This is already somewhat supported at the chunk level through the various
convert...
methods and theDuckDBValueConverter
interface (and indeed this is what theget...Json
methods use). But it would be more convenient to have top-level methods onDuckDBResult
andDuckDBResultReader
to get data using a custom converter.Additionally, it would be helpful to be able to specify custom conversion by starting from an existing, library-supplied converter and only specifying the (usually few) differences desired.
One example of doing this is the pg-promise API:
(From https://stackoverflow.com/questions/39168501/pg-promise-returns-integers-as-strings)
The text was updated successfully, but these errors were encountered: