Daily
journal
updated: 04/22/26
created: 04/07/26
My probably not so "daily" log! This is a habit I've gotten into at work, primarily for keeping track of what I'm working on, but it's also a nice way to reflect on what's completed, stuff I'm thinking about, or whatever.
04/22/26:
- Found a nifty library today called nuqs for type-safe parsing of search params via a react-style "useQueryState" hook. CopDB stores table filter options in the URL string, and we've been using our own handrolled utilities for parsing search params into their expected types -- which work well enough right now, but they've just kinda been hacked together as needed. So I'm stoked to see if this library would be a good replacement! One thing that I like about our utilities that I'm hoping to replicate with nuqs (which I think useQueryStates may be able to), is that all available search params are defined by an interface which corresponds to the request params the API expects. So instead of working with individual values parsed from the URL string, we get a full "filter" object that's populated with the defined search params which we just pass as the request to the API.
04/10/26:
- Made it through the week! Had some fun at work today - our bulk-customer import job is humming along nicely, and we've got a more realistic dataset (~7 million rows) to play with locally. So now we were able to get a rough idea for the performance of our phone number lookup query.
- As expected, our first pass with "ilike"ing the phone number results in a full table scan, which is too slow! But the legend that is my partner added a GIN index to that column, and without changing any application code, local queries went from >8s to 5-10ms! We've still got a bunch of cleaning up to do and need to actually get the thing deployed and running, but that was a neat lil reminder about the efficacy of indexes!
04/07/26:
- Took the day off from work cus I was not feeling it! Instead, I made some updates to my personal site and just chiiiilled.
- Added new CopDB screenshots to the project sections. The previous ones were probably a couple years old at this point, so it was neat to see the improvements we've made!
- Also updated the MDX components to recognize local vs external links, so I can use Next's client-side routing if I'm linking to pages on this site (like the project sections!).
- Cleaned up a bunch of old issues in our CopDB repos. A lot of the stuff I closed out in the web project was actually already completed, we just never closed the tickets. But the copdb-api issues page still has some nuggets we should revisit, like adding police unions and facilities.