1await connection.createQueryBuilder()
2 .insert()
3 .into(Post)
4 .values(post2)
5 .onConflict(`("id") DO NOTHING`)
6 .execute();
7
8await connection.createQueryBuilder()
9 .insert()
10 .into(Post)
11 .values(post2)
12 .onConflict(`("id") DO UPDATE SET "title" = :title`)
13 .setParameter("title", post2.title)
14 .execute();