mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-02 14:38:49 +00:00
simplify database handling across sql flavors (#279)
This commit is contained in:
1 parent
dbd01c52da
commit
7ed005afeb
33 files changed
+188
-210
No files matched your search
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,9 @@
|
||||
INSERT IGNORE INTO carbon_users SET
|
||||
id = :id,
|
||||
muted = :muted,
|
||||
deafened = :deafened,
|
||||
selectedchannel = :selectedchannel,
|
||||
displayname = :displayname,
|
||||
lastwhispertarget = :lastwhispertarget,
|
||||
whisperreplytarget = :whisperreplytarget,
|
||||
spying = :spying;
|
||||
@@ -1 +0,0 @@
|
||||
DELETE FROM carbon_ignores WHERE (id = UNHEX(REPLACE(:id, '-', '')));
|
||||
@@ -1 +0,0 @@
|
||||
DELETE FROM carbon_leftchannels WHERE (id = UNHEX(REPLACE(:id, '-', '')));
|
||||
@@ -1,19 +0,0 @@
|
||||
INSERT INTO carbon_users SET
|
||||
id = UNHEX(REPLACE(:id, '-', '')),
|
||||
muted = :muted,
|
||||
deafened = :deafened,
|
||||
selectedchannel = :selectedchannel,
|
||||
displayname = :displayname,
|
||||
lastwhispertarget = UNHEX(REPLACE(:lastwhispertarget, '-', '')),
|
||||
whisperreplytarget = UNHEX(REPLACE(:whisperreplytarget, '-', '')),
|
||||
spying = :spying
|
||||
ON DUPLICATE KEY UPDATE
|
||||
id = UNHEX(REPLACE(:id, '-', '')),
|
||||
muted = :muted,
|
||||
deafened = :deafened,
|
||||
selectedchannel = :selectedchannel,
|
||||
displayname = :displayname,
|
||||
lastwhispertarget = UNHEX(REPLACE(:lastwhispertarget, '-', '')),
|
||||
whisperreplytarget = UNHEX(REPLACE(:whisperreplytarget, '-', '')),
|
||||
spying = :spying
|
||||
;
|
||||
@@ -1 +0,0 @@
|
||||
INSERT IGNORE INTO carbon_ignores (id, ignoredplayer) VALUES(UNHEX(REPLACE(:id, '-', '')), UNHEX(REPLACE(:ignoredplayer, '-', '')))
|
||||
@@ -1 +0,0 @@
|
||||
INSERT IGNORE INTO carbon_leftchannels (id, channel) VALUES(UNHEX(REPLACE(:id, '-', '')), :channel)
|
||||
@@ -1,9 +0,0 @@
|
||||
SELECT
|
||||
LOWER(CONCAT(
|
||||
LEFT(HEX(ignoredplayer), 8), '-',
|
||||
MID(HEX(ignoredplayer), 9, 4), '-',
|
||||
MID(HEX(ignoredplayer), 13, 4), '-',
|
||||
MID(HEX(ignoredplayer), 17, 4), '-',
|
||||
RIGHT(HEX(ignoredplayer), 12)
|
||||
)) AS ignoredplayer
|
||||
FROM carbon_ignores WHERE (id = UNHEX(REPLACE(:id, '-', '')));
|
||||
@@ -1 +0,0 @@
|
||||
SELECT channel FROM carbon_leftchannels WHERE (id = UNHEX(REPLACE(:id, '-', '')));
|
||||
@@ -1,28 +0,0 @@
|
||||
SELECT
|
||||
LOWER(CONCAT(
|
||||
LEFT(HEX(id), 8), '-',
|
||||
MID(HEX(id), 9, 4), '-',
|
||||
MID(HEX(id), 13, 4), '-',
|
||||
MID(HEX(id), 17, 4), '-',
|
||||
RIGHT(HEX(id), 12)
|
||||
)) AS id,
|
||||
muted,
|
||||
deafened,
|
||||
selectedchannel,
|
||||
displayname,
|
||||
LOWER(CONCAT(
|
||||
LEFT(HEX(lastwhispertarget), 8), '-',
|
||||
MID(HEX(lastwhispertarget), 9, 4), '-',
|
||||
MID(HEX(lastwhispertarget), 13, 4), '-',
|
||||
MID(HEX(lastwhispertarget), 17, 4), '-',
|
||||
RIGHT(HEX(lastwhispertarget), 12)
|
||||
)) AS lastwhispertarget,
|
||||
LOWER(CONCAT(
|
||||
LEFT(HEX(whisperreplytarget), 8), '-',
|
||||
MID(HEX(whisperreplytarget), 9, 4), '-',
|
||||
MID(HEX(whisperreplytarget), 13, 4), '-',
|
||||
MID(HEX(whisperreplytarget), 17, 4), '-',
|
||||
RIGHT(HEX(whisperreplytarget), 12)
|
||||
)) AS whisperreplytarget,
|
||||
spying
|
||||
FROM carbon_users WHERE (id = UNHEX(REPLACE(:id, '-', '')));
|
||||
@@ -1,19 +0,0 @@
|
||||
INSERT INTO carbon_users SET
|
||||
id = :id,
|
||||
muted = :muted,
|
||||
deafened = :deafened,
|
||||
selectedchannel = :selectedchannel,
|
||||
displayname = :displayname,
|
||||
lastwhispertarget = :lastwhispertarget,
|
||||
whisperreplytarget = :whisperreplytarget,
|
||||
spying = :spying
|
||||
ON CONFLICT (id) DO UPDATE SET
|
||||
id = :id,
|
||||
muted = :muted,
|
||||
deafened = :deafened,
|
||||
selectedchannel = :selectedchannel,
|
||||
displayname = :displayname,
|
||||
lastwhispertarget = :lastwhispertarget,
|
||||
whisperreplytarget = :whisperreplytarget,
|
||||
spying = :spying
|
||||
;
|
||||
@@ -1 +0,0 @@
|
||||
INSERT INTO carbon_ignores (id, ignoredplayer) VALUES(:id, :ignoredplayer)
|
||||
@@ -1 +0,0 @@
|
||||
INSERT INTO carbon_leftchannels (id, channel) VALUES(:id, :channel)
|
||||
@@ -0,0 +1 @@
|
||||
INSERT IGNORE INTO carbon_ignores (id, ignoredplayer) VALUES(:id, :ignoredplayer)
|
||||
@@ -0,0 +1 @@
|
||||
INSERT IGNORE INTO carbon_leftchannels (id, channel) VALUES(:id, :channel)
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,9 @@
|
||||
UPDATE carbon_users SET
|
||||
id = :id,
|
||||
muted = :muted,
|
||||
deafened = :deafened,
|
||||
selectedchannel = :selectedchannel,
|
||||
displayname = :displayname,
|
||||
lastwhispertarget = :lastwhispertarget,
|
||||
whisperreplytarget = :whisperreplytarget,
|
||||
spying = :spying;
|
||||
Reference in new issue
Block a user