16 lines
479 B
TypeScript
16 lines
479 B
TypeScript
import { PrismaClient } from '@prisma/client'
|
|||
|
|
|
||
|
|
const prisma = new PrismaClient()
|
||
|
|
|
||
|
|
async function main() {
|
||
|
|
const a = await prisma.$queryRaw<Array<{ n: bigint }>>`SELECT nextval('order_number_seq') AS n`
|
||
|
|
const b = await prisma.$queryRaw<Array<{ n: bigint }>>`SELECT nextval('order_number_seq') AS n`
|
||
|
|
console.log(JSON.stringify({ first: String(a[0]!.n), second: String(b[0]!.n) }))
|
||
|
|
await prisma.$disconnect()
|
||
|
|
}
|
||
|
|
|
||
|
|
main().catch((e) => {
|
||
|
|
console.error(e)
|
||
|
|
process.exit(1)
|
||
|
|
})
|