Tile server migration - #262
Conversation
| return True | ||
|
|
||
|
|
||
| def build_db_query(tile): |
There was a problem hiding this comment.
This should all be using sqlalchemy models not raw sql
eveleighoj
left a comment
There was a problem hiding this comment.
this needs more work. It needs to imitate how other routers are done in the codebase.
have a look at the search entities function it's not perfect but it's structure should help.
the router function should depend on a database connection, it should then use a data_access function to get the data. the routers job is to then map this data to an output for the user (whether that be a html page or something else)
| router = APIRouter() | ||
| logger = logging.getLogger(__name__) | ||
|
|
||
| DATABASE = {"user": "", "password": "", "host": "", "port": "5432", "database": ""} |
There was a problem hiding this comment.
all database info should be managed from the db section this is clearly just development code that was user before. the db folder has the relevant stuff for connecting so don't use whatever is below
|
|
||
|
|
||
| @router.get("/-/tiles/{dataset}/{z}/{x}/{y}.vector.{fmt}") | ||
| async def read_tiles_from_postgres(dataset: str, z: int, x: int, y: int, fmt: str): |
There was a problem hiding this comment.
this is moderately useful as lays out the main router function but should be using different code underneath.
There was a problem hiding this comment.
There is a question over the async nature of this, I'm not sure we use it elsewhere in the application. I'm not against it but would need to check it works okay.
There was a problem hiding this comment.
I'm not sure the router needs to be tiles_ it should probably just be tiles
| ), "Should raise HTTP 400 for invalid tile parameters" | ||
|
|
||
|
|
||
| @pytest.mark.asyncio |
There was a problem hiding this comment.
These don't seem like unit tests, maybe more acceptance tests
No description provided.