Closed jskupsik closed 3 months ago
We could also potentially do SELECT 1 FROM xh_monitor WHERE code = 'xhDbConnectionMonitor'
- if we are worried about *
fetching too much data.
Not sure why we had that LIMIT 1 in there given that code has a unique constraint - thanks for fixing!
Wish we had just made this configurable via params - found it failing on a deployment, went to adjust the monitor config then remembered this is hard-coded.
I don't feel too bad about that -- I think this is more appropriate than config driven sql would have been
The existing query,
SELECT * FROM xh_monitor WHERE code = 'xhDbConnectionMonitor' LIMIT 1
, does not work in SQL Server (Microsoft SQL). The equivalent statement in SQL Server would beSELECT TOP(1) * FROM xh_monitor WHERE code = 'xhDbConnectionMonitor'
I propose we simplify it to the SQL statement
SELECT * FROM xh_monitor WHERE code = 'xhDbConnectionMonitor'
, which should work in all dialects.