Skip to content

Commit 99f7912

Browse files
committed
test: just a test file
1 parent ab90b98 commit 99f7912

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

test/query.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { PrismaPg } from "@prisma/adapter-pg";
2+
import { PrismaClient } from "generated/prisma/client";
3+
import { config } from "src/config/app.config";
4+
5+
class PrismaQuery {
6+
private readonly adapter: PrismaPg;
7+
private readonly prisma: PrismaClient;
8+
9+
constructor() {
10+
this.adapter = new PrismaPg({
11+
connectionString: config.db.url,
12+
});
13+
this.prisma = new PrismaClient({ adapter: this.adapter });
14+
}
15+
16+
async run() {
17+
const getAllApp = await this.prisma.applicationInfo.findMany({
18+
where: {
19+
std_info_education_level: {
20+
not: null,
21+
},
22+
},
23+
});
24+
25+
console.log(new Set(getAllApp.map((q) => decodeURI(q.std_info?.std_info_education_level || ""))));
26+
}
27+
}
28+
29+
const prismaQuery = new PrismaQuery();
30+
prismaQuery.run();

0 commit comments

Comments
 (0)