Issues with supabase inserts with drizzle

        const team = await db.transaction(async (tx) => {
            const [team] = await tx.insert(teams).values(teamObj).returning();

            await tx.insert(team_stats).values({
                team_id: team.id,
                total_losses: 0,
                total_wins: 0,
                xp: 0,
                total_money_earned: 0,
                total_money_lost: 0
            });

            await tx.insert(user_teams).values({
                team_id: team.id,
                user_id: Number(locals.user.id)
            });

            return team;
        });

        //make sure team is in db
        const [test] = await db.query.teams.findMany({
            where: (teams, { eq }) => eq(teams.id, team.id)
        });


the transaction returns the team object with id from supabase db but when querying it to make sure it exists the team is not found. not sure whats going on exactly would love some clarification on is i'm just missing something
Was this page helpful?