impress-2020/src/server
Matchu 3744a476e5 Fix db transactions with pooling
Ah okay, pools support `query` and `execute` the same way connection objects do (as a shorthand for acquiring, querying, and releasing), but it doesn't have the same helpers for transactions. Makes sense: you need those queries to go to the same connection, and an API where you just call it against the pool object can't tell that it's part of the same thing!

Now, we have our transaction code explicitly acquire a connection to use for the duration of the transaction.

An alternative considered would have been to have `connectToDb` acquire a connection, and then release it at the end of the GraphQL request. That would have made app code simpler, but added a lot of additional potential surprise failure points to the infra imo (e.g. what if we're misunderstanding the GraphQL codepath and the connection never gets released? whereas here it's relatively easy to audit that there's a `finally` in the right spot.)
2022-01-08 18:49:00 -08:00
..
__image_snapshots__ outfit-images: render actual PNG and SVG layers! 2021-01-04 05:58:19 +00:00
__snapshots__ simplify validPetPoses out of the server directory 2020-09-06 00:40:00 -07:00
lib Fix Typescript error with caching + new Apollo 2021-11-26 15:22:01 -08:00
types Fix db transactions with pooling 2022-01-08 18:49:00 -08:00
auth.js Fix misc lint errors 2021-05-03 15:06:07 -07:00
db.js Use a connection pool 2022-01-08 09:20:45 -08:00
index.js Send Vary: Authorization cache header 2021-11-23 13:00:56 -08:00
loaders.js Better-scoped queries for currentUserOwnsThis etc 2022-01-07 11:37:27 -08:00
modeling.js Lint against console.log 2021-05-03 15:01:49 -07:00
neopets-assets.js Support HTTPS asset URLs 2021-06-12 02:29:30 -07:00
outfit-images.js Fail harder when *all* layers fail to load 2021-09-03 14:55:50 -07:00
outfit-images.test.js Use Fastly to cache our PNG assets from S3 2021-05-12 22:49:59 -07:00
util.js Fix misc lint errors 2021-05-03 15:06:07 -07:00
util.test.js Fix misc lint errors 2021-05-03 15:06:07 -07:00