Skip to content

Commit 48fa416

Browse files
committed
Log database notices
1 parent b30bae1 commit 48fa416

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/lib/postgres.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
import postgres from 'postgres';
22

3-
export const sql = postgres((process.env.DATABASE_URL as string).split('?')[0], { onnotice: console.error, max: 1 });
3+
export const sql = postgres((process.env.DATABASE_URL as string).split('?')[0], {
4+
onnotice: notice => {
5+
if (notice.message.includes('already exists, skipping')) return;
6+
console.log('SQL Notice: ', notice.message);
7+
},
8+
max: 1
9+
});

0 commit comments

Comments
 (0)