I recently needed to sort query results to match the order of IDs passed to it for use in a WHERE β¦ IN()
clause. In MySQL, this can be done using the FIELD()
function in the ORDERY BY
clause. For Doctrine, which doesn’t have the FIELD()
function and doesn’t allow functions in the ORDER BY
clause, there’s a little more work needed to make use of it.
Toby's Log page 21
I signed up for the Ohio Vax-A-Million vaccine lottery at ohiovaxamillion.com, even though the site and domain registration seemed a little suspicious.
Continue reading post "#3417"New windows
When I bought my house, half of the regular windows had already been replaced with more efficient windows. I got the other half replaced last Tuesday.
Continue reading post "New windows"Stir Trek 2021
I watched the Stir Trek conference today, live streaming. It was done virtually this year due to the Covid situation.
Continue reading post "Stir Trek 2021"I had another tick, a big one, though this time it didn’t leave a mark at all.
Continue reading post "#3405"After another strong anxiety attack, I’ve been off and on sickly for over a week.
Continue reading post "#3402"I found myself needing to get the path to the current script and its directory in a local Node JS script recently. In Common JS scripts, that is available by __filename
or __dirname
globals, but it isn’t available by the same means in ES modules. Instead, there is import.meta.url
, which can be used to get at the directory name if needed, like:
const __filename = import.meta.url.replace(/^file:[\/]+/, '/');
const __dirname = __filename.split('/').slice(0, -1).join('/');
I think the deer are eating some of my bulb plant leaves.
Continue reading post "#3397"I planted some flowers in my garden today, and discovered a large number of acorns in my bags of soil and soil enhancer.
Continue reading post "#3391"I had another health incident yesterday. It kind of makes me feel like I’m dying.
Continue reading post "#3389"