Skip to content

Commit

Permalink
on conflict do nothing
Browse files Browse the repository at this point in the history
  • Loading branch information
kyscott18 committed Sep 25, 2024
1 parent b4e1b1e commit 5d835cf
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions packages/core/src/sync-store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -637,13 +637,7 @@ export const createSyncStore = ({
encodeTransaction({ transaction, chainId, dialect }),
),
)
.onConflict((oc) =>
oc.column("hash").doUpdateSet((eb) => ({
blockHash: eb.ref("excluded.blockHash"),
blockNumber: eb.ref("excluded.blockNumber"),
transactionIndex: eb.ref("excluded.transactionIndex"),
})),
)
.onConflict((oc) => oc.column("hash").doNothing())
.execute();
}
});
Expand Down Expand Up @@ -687,19 +681,7 @@ export const createSyncStore = ({
}),
),
)
.onConflict((oc) =>
oc.column("transactionHash").doUpdateSet((eb) => ({
blockHash: eb.ref("excluded.blockHash"),
blockNumber: eb.ref("excluded.blockNumber"),
contractAddress: eb.ref("excluded.contractAddress"),
cumulativeGasUsed: eb.ref("excluded.cumulativeGasUsed"),
effectiveGasPrice: eb.ref("excluded.effectiveGasPrice"),
gasUsed: eb.ref("excluded.gasUsed"),
logs: eb.ref("excluded.logs"),
logsBloom: eb.ref("excluded.logsBloom"),
transactionIndex: eb.ref("excluded.transactionIndex"),
})),
)
.onConflict((oc) => oc.column("transactionHash").doNothing())
.execute();
}
});
Expand Down

0 comments on commit 5d835cf

Please sign in to comment.