azavea/OTM2-tiler — pull request #15 by steventlamb (2013-07-30 17:39:44+00:00)
Title: Topic/more sql in config

Copied from a discussion email:

"""
I think that having the SQL that connects to an otm2 implementation live in the config is a good idea. In general, the more static assets can live in the config, the better. Even in cases where the config will not be changed (ie. over-abstraction), you end up with another layer of documentation, and a way for another developer to reason about how your app is functioning. I think this is especially true in the case of making connections to other applications. There is also the added bonus of looser coupling. It is better to have a dependent configuration than a dependent implementation.

As it stands, however, I think it's a little tough to reason about what static assets will be in the config vs the source code. For example, the var MODEL_MAPPING (link) in filterStringToWhere seems like something that might make more sense on the config, since we're already exposing table-level details to the config. It might also make sense to factor out the select statement in transformBoundaryPredicate (link), so that the SQL exposed in the source code is limited to predicate blobs.
"""