Drizzle and Turso not showing live data.

I'm currently using Drizzle and Turso, and have an api to add data into my database. However, I am only getting the data that was in the table before I added new data. When I view on Turso I see the updated data, and when I view through Drizzle Studio I am also seeing the updated data, however when I try to use my api to see the data it returns old data.

import { NextRequest, NextResponse } from 'next/server';
import { db } from '@/db';
import { auditsTable } from '@/db/schema';
import { sql } from 'drizzle-orm';

export const runtime = 'nodejs';

export async function GET(req: NextRequest) {
  try {
    // Fetch audits with a timeout
    const audits = await Promise.race([
      db.select().from(auditsTable).all(),
      new Promise((_, reject) => setTimeout(() => reject(new Error('Database query timed out')), 5000))
    ]) as typeof auditsTable.$inferSelect[];

    console.log(`Fetched ${audits.length} audits`);

    // Add cache control headers to prevent caching
    const response = NextResponse.json(audits);
    response.headers.set('Cache-Control', 'no-store, max-age=0');
    
    return response;
  } catch (error) {
    console.error('Error fetching audits:', error);

    if (error instanceof Error) {
      return NextResponse.json(
        { message: 'Error fetching audits', error: error.message },
        { status: 500 }
      );
    }

    return NextResponse.json({ message: 'Unknown error occurred' }, { status: 500 });
  }
}
This is my api call.
Was this page helpful?