mirror of
https://gitea.gofwd.group/dstrawsb/ballistic-builder.git
synced 2025-12-06 02:36:44 -05:00
queries
This commit is contained in:
@@ -1,12 +1,47 @@
|
||||
import { db } from '../../index';
|
||||
import { psa } from '../../../drizzle/schema';
|
||||
import { eq, lt, gte, ne } from 'drizzle-orm';
|
||||
|
||||
export async function getPSA(page = 1) {
|
||||
const limit = 10;
|
||||
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 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);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { pgTable, integer, varchar, uuid } from "drizzle-orm/pg-core";
|
||||
import { pgTable, integer, varchar, uuid } from "drizzle-orm/pg-core";
|
||||
import { sql } from "drizzle-orm";
|
||||
import { timestamps } from "./helpers/columns.helpers";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user