2023-03-15 08:35:16 +01:00
|
|
|
import { PrismaClient } from '@typebot.io/prisma'
|
2022-11-23 11:40:57 +01:00
|
|
|
import { promptAndSetEnvironment } from './utils'
|
|
|
|
|
|
|
|
const executePlayground = async () => {
|
|
|
|
await promptAndSetEnvironment()
|
2022-12-08 11:02:52 +01:00
|
|
|
const prisma = new PrismaClient({
|
|
|
|
log: [{ emit: 'event', level: 'query' }, 'info', 'warn', 'error'],
|
|
|
|
})
|
|
|
|
|
|
|
|
prisma.$on('query', (e) => {
|
|
|
|
console.log(e.query)
|
|
|
|
console.log(e.params)
|
|
|
|
console.log(e.duration, 'ms')
|
|
|
|
})
|
|
|
|
|
2024-01-02 11:03:30 +01:00
|
|
|
const result = await prisma.workspace.findMany({
|
|
|
|
where: {
|
|
|
|
members: {
|
|
|
|
some: {
|
|
|
|
user: {
|
|
|
|
email: '',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
include: {
|
|
|
|
members: true,
|
|
|
|
typebots: {
|
|
|
|
select: {
|
|
|
|
name: true,
|
|
|
|
riskLevel: true,
|
|
|
|
id: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
console.log(JSON.stringify(result))
|
|
|
|
|
|
|
|
// await prisma.bannedIp.deleteMany({})
|
|
|
|
|
|
|
|
// const result = await prisma.coupon.findMany({
|
|
|
|
// where: {
|
|
|
|
// code: '',
|
|
|
|
// },
|
|
|
|
// })
|
2022-12-22 17:02:34 +01:00
|
|
|
|
2024-01-02 11:03:30 +01:00
|
|
|
// console.log(result)
|
2022-11-23 11:40:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
executePlayground()
|