Files
ballistic-builder/src/db/queries/PSA/index.ts

48 lines
1.1 KiB
TypeScript
Raw Normal View History

import { db } from '../../index';
import { psa } from '../../../drizzle/schema';
2024-12-12 00:04:14 -05:00
import { eq, lt, gte, ne } from 'drizzle-orm';
export async function getPSA(page = 1) {
2024-12-12 00:04:14 -05:00
const limit = 20;
const offset = (page - 1) * limit;
return await db.select()
.from(psa)
.limit(limit)
2024-12-12 00:04:14 -05:00
.where(eq(psa.fineline, "Lower Build Kits"))
.offset(offset);
2024-12-12 00:04:14 -05:00
}
export async function getLowerBuildKits(page = 1) {
const limit = 20;
const offset = (page - 1) * limit;
return await db.select()
.from(psa)
.limit(limit)
.where(eq(psa.fineline, "Lower Build Kits"))
.offset(offset);
}
export async function getAKBarreledReceivers(page = 1) {
const limit = 20;
const offset = (page - 1) * limit;
return await db.select()
.from(psa)
.limit(limit)
.where(eq(psa.fineline, "AK Barreled Receivers"))
.offset(offset);
}
export async function getARCompleteLowers(page = 1) {
const limit = 20;
const offset = (page - 1) * limit;
return await db.select()
.from(psa)
.limit(limit)
.where(eq(psa.fineline, "AR Complete Lowers"))
.offset(offset);
}