Checklist
Checklist in the Databases guide.
- The connection string and tokens are read in
.servermodules, fromprocess.env, and are listed in the deployment's secrets, not inDUSK_PUBLIC_*variables (those are shipped to the browser). - One client per process, kept on
globalThissodusk devdoes not leak connections. - Migrations run at deploy time, before the new version takes traffic.
- Every database error that the caller can fix is mapped to an
HttpErrorwith the right status; the others reachonError. - Writes that belong together share a transaction.
- On an edge runtime the client is an HTTP one, and nothing opens a file or loads a native module.