const insertResult = await db
.insert(cryptoToken)
.values({
name: coin.name,
symbol: coin.symbol,
slug: coin.slug,
is_active: 1,
first_historical_data: coin.first_historical_data,
last_historical_data: coin.last_historical_data,
id: coin.id,
platforms: sql`ARRAY_CAT(${cryptoToken.platforms}, ARRAY['${coin.platform.id}'])`,
rank: coin.rank,
})
.onConflictDoUpdate({
target: cryptoToken.id,
set: {
name: coin.name,
symbol: coin.symbol,
slug: coin.slug,
is_active: 1,
first_historical_data: coin.first_historical_data,
last_historical_data: coin.last_historical_data,
platforms: sql`ARRAY_CAT(${cryptoToken.platforms}, ARRAY['${coin.platform.id}'])`,
rank: coin.rank,
},
});
const insertResult = await db
.insert(cryptoToken)
.values({
name: coin.name,
symbol: coin.symbol,
slug: coin.slug,
is_active: 1,
first_historical_data: coin.first_historical_data,
last_historical_data: coin.last_historical_data,
id: coin.id,
platforms: sql`ARRAY_CAT(${cryptoToken.platforms}, ARRAY['${coin.platform.id}'])`,
rank: coin.rank,
})
.onConflictDoUpdate({
target: cryptoToken.id,
set: {
name: coin.name,
symbol: coin.symbol,
slug: coin.slug,
is_active: 1,
first_historical_data: coin.first_historical_data,
last_historical_data: coin.last_historical_data,
platforms: sql`ARRAY_CAT(${cryptoToken.platforms}, ARRAY['${coin.platform.id}'])`,
rank: coin.rank,
},
});