2022-06-20 11:16:36 +02:00
|
|
|
import { PrismaClient } from 'db'
|
2022-02-25 09:45:31 +01:00
|
|
|
import path from 'path'
|
|
|
|
|
|
|
|
require('dotenv').config({
|
|
|
|
path: path.join(
|
|
|
|
__dirname,
|
2022-09-20 19:15:47 +02:00
|
|
|
process.env.NODE_ENV === 'staging' ? '.env.staging' : '.env.local'
|
2022-02-25 09:45:31 +01:00
|
|
|
),
|
|
|
|
})
|
|
|
|
|
2022-10-10 08:28:11 +02:00
|
|
|
const prisma = new PrismaClient({ log: ['query', 'info', 'warn', 'error'] })
|
2022-09-20 19:15:47 +02:00
|
|
|
|
2022-10-10 08:28:11 +02:00
|
|
|
const main = async () => {
|
|
|
|
const workspaces = await prisma.workspace.findMany({
|
|
|
|
where: {
|
|
|
|
members: { some: { userId: 'coucou' } },
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
console.log(workspaces)
|
|
|
|
}
|
2022-02-25 09:45:31 +01:00
|
|
|
|
|
|
|
main().then()
|