Snaccman
Snaccman
CC#
Created by Snaccman on 1/23/2024 in #help
Delete Query Not Executing via Dapper
Thats just so it doesnt the data for debugging, you can see it deletes 2600 rows. Dapper does not delete anything
7 replies
CC#
Created by Snaccman on 1/23/2024 in #help
Delete Query Not Executing via Dapper
DELETE
FROM leaderboard_guilds lg
USING (
SELECT
id,
guild_id,
snapshot_timestamp,
ROW_NUMBER() OVER (PARTITION BY guild_id, snapshot_timestamp::date ORDER BY id) AS row_num
FROM leaderboard_guilds
) rg
WHERE rg.row_num > 1
and rg.guild_id = lg.guild_id
and rg.snapshot_timestamp = lg.snapshot_timestamp
and rg.id = lg.id;
DELETE
FROM leaderboard_guilds lg
USING (
SELECT
id,
guild_id,
snapshot_timestamp,
ROW_NUMBER() OVER (PARTITION BY guild_id, snapshot_timestamp::date ORDER BY id) AS row_num
FROM leaderboard_guilds
) rg
WHERE rg.row_num > 1
and rg.guild_id = lg.guild_id
and rg.snapshot_timestamp = lg.snapshot_timestamp
and rg.id = lg.id;
7 replies
CC#
Created by Snaccman on 1/23/2024 in #help
Delete Query Not Executing via Dapper
I asked a SO question yesterday but haven't had anything useful back https://stackoverflow.com/questions/77863268/dapper-result-doesnt-match-pgadmin
7 replies
CC#
Created by Snaccman on 1/23/2024 in #help
Delete Query Not Executing via Dapper
Ive checked connection strings, running as super user, no explicit transaction, running a simple delete where id = '' and that works fine
7 replies
CC#
Created by Snaccman on 1/23/2024 in #help
Delete Query Not Executing via Dapper
Dapper execution. Count is zero and checking the db via dbeaver, can confirm nothing is deleted var count = await conn.ExecuteAsync(sql: sql, transaction: transaction, commandType: CommandType.Text);
7 replies