2022-06-19 11:10:11 +02:00
|
|
|
import { CollaborationType, PrismaClient } from 'db'
|
2022-02-25 09:45:31 +01:00
|
|
|
import path from 'path'
|
2022-06-19 11:10:11 +02:00
|
|
|
const prisma = new PrismaClient({
|
|
|
|
log: [
|
|
|
|
{
|
|
|
|
emit: 'event',
|
|
|
|
level: 'query',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
emit: 'stdout',
|
|
|
|
level: 'error',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
emit: 'stdout',
|
|
|
|
level: 'info',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
emit: 'stdout',
|
|
|
|
level: 'warn',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})
|
2022-02-25 09:45:31 +01:00
|
|
|
|
|
|
|
require('dotenv').config({
|
|
|
|
path: path.join(
|
|
|
|
__dirname,
|
2022-03-29 08:45:20 +02:00
|
|
|
process.env.NODE_ENV === 'production' ? '.env.production' : '.env.local'
|
2022-02-25 09:45:31 +01:00
|
|
|
),
|
|
|
|
})
|
|
|
|
|
2022-05-13 15:22:44 -07:00
|
|
|
const main = async () => {
|
2022-06-19 11:10:11 +02:00
|
|
|
prisma.$on('query', (e) => {
|
|
|
|
console.log('Query: ' + e.query)
|
|
|
|
console.log('Params: ' + e.params)
|
|
|
|
console.log('Duration: ' + e.duration + 'ms')
|
|
|
|
})
|
|
|
|
const results =
|
|
|
|
await prisma.$queryRaw`DELETE FROM "public"."Result" WHERE "public"."Result"."typebotId"='ckzqqer3j002509l3np5x3v2y'`
|
|
|
|
console.log(results)
|
2022-05-13 15:22:44 -07:00
|
|
|
}
|
2022-02-25 09:45:31 +01:00
|
|
|
|
|
|
|
main().then()
|