Skip to content

Commit

Permalink
query templates
Browse files Browse the repository at this point in the history
  • Loading branch information
dbauszus-glx committed Oct 27, 2023
1 parent fd19449 commit 3eafd59
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 51 deletions.
56 changes: 5 additions & 51 deletions mod/workspace/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ const mail_templates = require('./templates/mails')

const msg_templates = require('./templates/msgs')

const query_templates = require('./templates/queries')

async function cache() {

// Get workspace from source.
Expand All @@ -56,58 +58,10 @@ async function cache() {
...view_templates,
...mail_templates,
...msg_templates,
...custom_templates,
...query_templates,

// Query templates:
gaz_query: {
template: require('./templates/gaz_query'),
},
get_last_location: {
template: require('./templates/get_last_location'),
},
distinct_values: {
template: require('./templates/distinct_values'),
},
field_stats: {
template: require('./templates/field_stats'),
},
field_min: {
template: require('./templates/field_min'),
},
field_max: {
template: require('./templates/field_max'),
},
get_nnearest: {
render: require('./templates/get_nnearest'),
},
geojson: {
render: require('./templates/geojson'),
},
cluster: {
render: require('./templates/cluster'),
reduce: true
},
cluster_hex: {
render: require('./templates/cluster_hex'),
reduce: true
},
wkt: {
render: require('./templates/wkt'),
reduce: true
},
infotip: {
render: require('./templates/infotip'),
},
layer_extent: {
template: require('./templates/layer_extent'),
},
mvt_cache: {
admin: true,
render: require('./templates/mvt_cache'),
},
mvt_cache_delete_intersects: {
template: require('./templates/mvt_cache_delete_intersects'),
},
// Can override default templates.
...custom_templates,

// Default templates can be overridden by assigning a template with the same name.
...workspace.templates
Expand Down
51 changes: 51 additions & 0 deletions mod/workspace/templates/queries.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
module.exports = {
gaz_query: {
template: require('./gaz_query'),
},
get_last_location: {
template: require('./get_last_location'),
},
distinct_values: {
template: require('./distinct_values'),
},
field_stats: {
template: require('./field_stats'),
},
field_min: {
template: require('./field_min'),
},
field_max: {
template: require('./field_max'),
},
get_nnearest: {
render: require('./get_nnearest'),
},
geojson: {
render: require('./geojson'),
},
cluster: {
render: require('./cluster'),
reduce: true
},
cluster_hex: {
render: require('./cluster_hex'),
reduce: true
},
wkt: {
render: require('./wkt'),
reduce: true
},
infotip: {
render: require('./infotip'),
},
layer_extent: {
template: require('./layer_extent'),
},
mvt_cache: {
admin: true,
render: require('./mvt_cache'),
},
mvt_cache_delete_intersects: {
template: require('./mvt_cache_delete_intersects'),
}
}

0 comments on commit 3eafd59

Please sign in to comment.