18 lines
821 B
Diff
18 lines
821 B
Diff
diff --git a/dist/index.mjs b/dist/index.mjs
|
|
--- a/dist/index.mjs
|
|
+++ b/dist/index.mjs
|
|
@@ -52,7 +52,12 @@ const drizzleAdapter = (db, config) => {
|
|
}
|
|
const withReturning = async (model, builder, data, where) => {
|
|
if (config.provider !== "mysql") return (await builder.returning())[0];
|
|
- await builder.execute();
|
|
+ const mutationResult = await builder.execute();
|
|
+ const mysqlResult = Array.isArray(mutationResult) ? mutationResult[0] : mutationResult;
|
|
+ if (model === "oauthRefreshToken" && where?.some((w) => w.field === "revoked")) {
|
|
+ const affectedRows = mysqlResult?.affectedRows ?? mysqlResult?.rowsAffected ?? mysqlResult?.changes;
|
|
+ if (affectedRows === 0) return null;
|
|
+ }
|
|
const schemaModel = getSchema(model);
|
|
const builderVal = builder.config?.values;
|
|
if (where?.length) {
|