-
-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support z,x,y and record-returning funcs, table rework #380
Conversation
* All tests and internal code now uses ST_TileEnvelope function * Remove `tile_bbox` * Rename test function sources for clarity - this will be needed in a subsequent PR to add other function tests
Can handle the `getmvt(z,x,y) -> [bytea,md5]` case and several others.
* All table sources now use the same system as functions * Proper table name escaping * Prepared statements might speed things up, but this is not certain because we prepare on each get request. At least now we can optimize in one place.
BREAKING: * srid is now the same type as PG -- i32 * renamed config vals `table_sources` and `function_sources` into `tables` and `functions` Fixes: * predictable order of instantiation * bounding boxes computed in parallel for all tables (when not configured) * split up discovery and query creation - this way user overrides happen before the final query is generated * more proper name escaping * lots of test improvements
* Fix id column issue * Detect if postgis is newer than 3.1 and use st_tileenvolope margin param
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this looks good 👍
assert_eq!(t, &["bytea", "text"]); | ||
} | ||
(None, None) => {} | ||
_ => panic!("Invalid output record names or types"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe skip such functions and use warn!
instead of panic!
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a validation that SQL matches Rust code -- and uses lots of asserts for that. In theory the whole thing can be rewritten to use warnings, but I would rather panic early and fix the logic bugs than to make it go unnoticed. TBD i guess
Can now handle several additional Postgres functions to get a tile, plus tons of small fixes
Multiple result variants
getmvt(z,x,y) -> [bytea,md5]
(single row with two columns)getmvt(z,x,y) -> [bytea]
(single row with a single column)getmvt(z,x,y) -> bytea
(value)Multiple input parameter variants
getmvt(z, x, y)
orgetmvt(zoom, x, y)
(all 3 vars must be integers)getmvt(z, x, y, url_query)
, where instead ofurl_query
it could be any other name, but must be of type JSONBreaking
i32
table_sources
andfunction_sources
intotables
andfunctions
Features and fixes
Notes
(PgSqlInfo, FunctionInfo)
(or table) tupples containing SQL needed to get the tile.fixes #378
fixes #466
fixes #65
fixes #389