import { asc } from "drizzle-orm";
import { db as prodDb } from "../../db/index.ts";
import { tags } from "../../db/schema.ts";

type Db = typeof prodDb;

export async function getAllTags(db: Db = prodDb) {
	return db
		.select({ id: tags.id, name: tags.name })
		.from(tags)
		.orderBy(asc(tags.name));
}
