kalisio / krawler

A minimalist (geospatial) ETL
https://kalisio.github.io/krawler/
MIT License
54 stars 13 forks source link

Allow to disable automated type conversion when templating a query #240

Closed claustres closed 1 year ago

claustres commented 1 year ago

Most of the time we'd like to convert back to typed objects after templating and the automated conversion process works just fine. However, sometimes w'd like to keep the result as a string even if it can be converted to eg a number. It should be possible to deactivate automated type conversion on specific properties.

Maybe we might consider templating the whole query at once, expecting a JSON string representing the query as output that should then be parsed by JSON.parse(). This way it will be at least possible to have control over number, string or array conversion but template string will probably be more complex. However, some automated conversions like date objects will not be supported out of the box. Maybe we also need something more complete like a JSON schema to define all conversion rules in details ?