Supabase trying to push duplicated primary key ID

I'm inserting some data in a table, without ANY 'unique' stuff but the primary ID, I'm not specifying the ID on my query, but I'm getting

message: 'duplicate key value violates unique constraint "0xd_pkey"'

In return, with, in the details, a random ID that is incremented by 1 each time I retry the call.

Code example:

import { MetaSupabase } from "../supabase";

const supabase = new MetaSupabase();

(async () => {
supabase
.from("0xd")
.insert({
address: "0xd79b4d1bd46a998b89e462b780fd0875c60e3bfe",
token0_address: "0x52bb5ad0f59a35a7bf7f111f57cfd25dc0ccecea",
token0_type: "other",
token0_decimals: 9,
token0_priceUSD: 0,
token0_id: 330,
token1_address: "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c",
token1_type: "eth",
token1_decimals: 18,
token1_priceUSD: 0,
token1_id: null,
pair_data: {
volumeToken0: 0,
volumeToken1: 0,
volumeUSD: 0,
reserve0: 0,
reserve1: 0,
reserveUSD: 0,
},
created_at_date: "2022-10-20T12:17:02.000Z",
created_at_block: 22338794,
blockchain: "BNB Smart Chain (BEP20)",
})
.then(console.log);
})();
Was this page helpful?