mirror of
https://github.com/umami-software/umami.git
synced 2025-12-08 05:12:36 +01:00
Build cli using rollup.
This commit is contained in:
parent
533ffbda13
commit
0f0b1e39e7
10 changed files with 175 additions and 23 deletions
13
lib/db.js
13
lib/db.js
|
|
@ -1,7 +1,18 @@
|
|||
import { PrismaClient } from '@prisma/client';
|
||||
|
||||
export const prisma = new PrismaClient({
|
||||
log: [process.env.NODE_ENV !== 'production' && 'query'],
|
||||
log: [
|
||||
{
|
||||
emit: 'event',
|
||||
level: 'query',
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
prisma.on('query', e => {
|
||||
if (process.env.LOG_QUERY) {
|
||||
console.log(`${e.query} (${e.duration}ms)`);
|
||||
}
|
||||
});
|
||||
|
||||
export async function runQuery(query) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue