-
Hi, I would like to use the postgis flavor of postgres to make geo-aware queries, like finding entries within a bounding box. There is the knex-postgis extension that would do the job on the knex side. For feathers, I am wondering how I can extend/configure the built-in Should I develop my own db adapter or there is a more elegant solution? Thx |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You can still extend the knexify(knexQuery: Knex.QueryBuilder, query: Query = {}, parentKey?: string): Knex.QueryBuilder {
const q = super.knexify(knexQuery, query)
return Object.keys(query).reduce((currentQuery, key) => {
if (key === '$within') {
const [lat, lon] = query[key]
currentQuery.within(lat, lon)
}
return currentQuery
})
} |
Beta Was this translation helpful? Give feedback.
You can still extend the
createQuery
orknexify
methods and add your own functionality.