I am using drizzle ORM with my Next.js & PostgreSQL
I want to get the data from the newest data to the first one
I know orderBy()
could help me ! for id
of my post Iam using uuid
const allData = await db.select().from(articlesTable).orderBy(?);
this could be my answer
const allData = (await db.select().from(articlesTable)).reverse();
but I don’t want get all data because may I want to use limit(10)
and just select 10 last (newest) rows of my table for that no need to get all rows from database !