You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@dylanbun created a new config table to make it easier to update configs on the fly (PR #3320). The code definitely needs some work though!
First, instead of the giant ConfigApi class, we should have a smaller case class (maybe called MapParams) that just holds a map center lat/lng, 2 corners of a bounding box in lat/lngs, and a zoom level. This case class can be reused 4 times in the definition of the table in Scala. This will make the following changes easier and cleaner, but the later ones should be done even if we aren't able to figure out how to do this one.
Replace the million getters in ConfigTable.scala with getters that package things together that we use together. This will make the code cleaner and it will reduce the number of SQL queries we make. Right now getting each value is it's own SQL query, which is highly inefficient.
We can probably make some toJSON functions that will package up the data we access in multiple places nicely into JSON. This one will be a lot easier if we can split in to the smaller case classes, but it might be useful anyway, not sure.
The text was updated successfully, but these errors were encountered:
Brief description of problem/feature
@dylanbun created a new config table to make it easier to update configs on the fly (PR #3320). The code definitely needs some work though!
First, instead of the giant
ConfigApi
class, we should have a smaller case class (maybe calledMapParams
) that just holds a map center lat/lng, 2 corners of a bounding box in lat/lngs, and a zoom level. This case class can be reused 4 times in the definition of the table in Scala. This will make the following changes easier and cleaner, but the later ones should be done even if we aren't able to figure out how to do this one.Replace the million getters in
ConfigTable.scala
with getters that package things together that we use together. This will make the code cleaner and it will reduce the number of SQL queries we make. Right now getting each value is it's own SQL query, which is highly inefficient.We can probably make some
toJSON
functions that will package up the data we access in multiple places nicely into JSON. This one will be a lot easier if we can split in to the smaller case classes, but it might be useful anyway, not sure.The text was updated successfully, but these errors were encountered: