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

49 lines
1.2 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);
}
2024-12-12 10:34:50 -05:00
// DISABLING FOR NOW. NO NEED FOR AK. FOCUS ON AR15
// export async function getAKBarreledReceivers(page = 1) {
// const limit = 20;
// const offset = (page - 1) * limit;
2024-12-12 00:04:14 -05:00
2024-12-12 10:34:50 -05:00
// return await db.select()
// .from(psa)
// .limit(limit)
// .where(eq(psa.fineline, "AK Barreled Receivers"))
// .offset(offset);
// }
2024-12-12 00:04:14 -05:00
export async function getARCompleteLowers(page = 1) {
2024-12-12 10:34:50 -05:00
const limit = 40;
2024-12-12 00:04:14 -05:00
const offset = (page - 1) * limit;
return await db.select()
.from(psa)
.limit(limit)
.where(eq(psa.fineline, "AR Complete Lowers"))
.offset(offset);
}