asynccreateUserWithEmail(email){try{const record =awaituseDB().insert(tables.users).values({ email }).onConflictDoNothing().returning().get();return record;}catch(error){console.error(error);thrownewError("Failed to upsert user");}}
asyncupdateUser(userId, payload){try{const record =awaituseDB().update(tables.users).set(payload).where(eq(tables.users.id, userId)).returning().get();return record;}catch(error){console.error(error);thrownewError("Failed to update user");}}
asyncdeleteUser(userId){try{const record =awaituseDB().delete(tables.users).where(eq(tables.users.id, userId)).returning().get();return record;}catch(error){console.error(error);thrownewError(`Failed to delete user: ${error}`);}}