Commit Graph

11 Commits

Author SHA1 Message Date
e73d5d5f88 Attempt to migrate to sqlx 0.4.0-beta.1
There's still a ton of stuff broken. It's honestly too much to deal with right now so I'm abandoning it until it's released officially.
2020-10-28 12:25:36 -04:00
db8ccb3ca4 Rename the project and add more README docs 2020-10-12 20:54:34 -04:00
170a3a8b02 Remove bytes dependency 2020-08-01 02:24:39 -04:00
519fcb4c5a Add caching with LRU cache under mutex
Caches responses of each GET handler in a separate capacity-limited cache (as a
custom clone-able `CachedResponse` struct). Subsequent requests will build a
`Response` from the cached bytes instead of re-querying the database and
re-serializing the JSON. This greatly speeds up the list endpoints and
`get_interior_ref_list`.

Also caches the api-key-to-id mapping for `Owner`s in order to speed up frequent
authentications.

Each create handler clears the entire list response cache. Each delete handler
also clears the entire list response cache and deletes the cached response for
that key. Deleting an owner also deletes their entry in the
`owner_ids_by_api_key` cache.
2020-08-01 00:25:04 -04:00
17cd3f12d2 Improve model query performance tracing 2020-07-28 22:01:57 -04:00
b16ba3e3f7 Swap out old log for shiny tracing 2020-07-27 22:36:48 -04:00
fb99afdc26 Encode/decode InteriorRef struct from jsonb column 2020-07-27 00:09:45 -04:00
65e6ba1f8a WIP adding interior_refs endpoints
Ran into some limitations of sqlx while trying to bulk create interior_refs. I
also discovered how slow creating hundreds of rows in postgres is and I'm
planning on saving interior_refs data in a jsonb column instead which seems to
be much faster.
2020-07-19 03:01:20 -04:00
9ec7fc1518 Modularize, Model trait, list_owners 2020-07-18 17:46:33 -04:00
aebcaf7d21 Working shops and owners create/get endpoints 2020-07-16 00:42:04 -04:00
91ff001c53 Initial commit. WIP shops endpoint
Pretty comfortable with the choice of crates now so it's time to start
committing.

Currently the API only returns errors, but throwing good errors is important.
2020-07-13 01:55:36 -04:00