Skip to content

Commit a7c1793

Browse files
committed
refactor: 💡 remove table sources filter support
BREAKING CHANGE: remove table sources `filter` query param support
1 parent 5eeef48 commit a7c1793

File tree

5 files changed

+3
-22
lines changed

5 files changed

+3
-22
lines changed

Cargo.lock

Lines changed: 0 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ docopt = "1"
1010
env_logger = "0.6"
1111
futures = "0.1"
1212
log = "0.4"
13-
mapbox_expressions_to_sql = "0.1.0"
1413
num_cpus = "1.0"
1514
postgres = { version = "0.15", features = ["with-time", "with-uuid", "with-serde_json"] }
1615
r2d2 = "0.8"

src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ extern crate actix_web;
33
extern crate docopt;
44
extern crate env_logger;
55
extern crate futures;
6-
extern crate mapbox_expressions_to_sql;
76
extern crate tilejson;
87
#[macro_use]
98
extern crate log;

src/scripts/get_tile.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ SELECT ST_AsMVT(tile, '{id}', {extent}, 'geom' {id_column}) FROM (
33
SELECT
44
ST_AsMVTGeom({geometry_column_mercator}, bounds.mercator, {extent}, {buffer}, {clip_geom}) AS geom {properties}
55
FROM {id}, bounds
6-
WHERE {geometry_column} && bounds.original {condition}
6+
WHERE {geometry_column} && bounds.original
77
) AS tile WHERE geom IS NOT NULL

src/table_source.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use mapbox_expressions_to_sql;
21
use std::collections::HashMap;
32
use std::error::Error;
43
use std::io;
@@ -34,7 +33,7 @@ impl Source for TableSource {
3433
&self,
3534
conn: &PostgresConnection,
3635
xyz: &XYZ,
37-
query: &Query,
36+
_query: &Query,
3837
) -> Result<Tile, io::Error> {
3938
let mercator_bounds = utils::tilebbox(xyz);
4039

@@ -65,10 +64,6 @@ impl Source for TableSource {
6564
.clone()
6665
.map_or("".to_string(), |id_column| format!(", '{}'", id_column));
6766

68-
let condition = query
69-
.get("filter")
70-
.and_then(|filter| mapbox_expressions_to_sql::parse(filter).ok());
71-
7267
let query = format!(
7368
include_str!("scripts/get_tile.sql"),
7469
id = self.id,
@@ -80,8 +75,7 @@ impl Source for TableSource {
8075
extent = self.extent.unwrap_or(DEFAULT_EXTENT),
8176
buffer = self.buffer.unwrap_or(DEFAULT_BUFFER),
8277
clip_geom = self.clip_geom.unwrap_or(DEFAULT_CLIP_GEOM),
83-
properties = properties,
84-
condition = condition.map_or("".to_string(), |condition| format!("AND {}", condition)),
78+
properties = properties
8579
);
8680

8781
let tile: Tile = conn

0 commit comments

Comments
 (0)