This commit is contained in:
seb
2026-09-30 22:37:40 +02:00
parent 3d2f8e9296
commit 74ed74fc68
19 changed files with 122 additions and 56 deletions

View File

@@ -16,6 +16,9 @@ export default function create(provider) {
* // => 1
*/
return async (rate, tx) => {
if (typeof rate !== 'number' || !Number.isFinite(rate) || rate < 0) {
throw new Error('Invalid tax rate');
}
const result = await makeRunner(provider, tx).query(sql, { rate });
return result.rows[0]?.id ?? result.insertId;
};