A New Word: Addleworth

addleworth – adj. unable to settle the question of whether you’re doing okay in life; feeling torn between conflicting value systems and moveable goalposts, which makes you long for someone to come along and score your progress in discrete and measurable units – points, dollars, friends, followers, or a grade point average – which may not clear up where you’re going, but would at least reassure you that you’re one step closer to getting there.

This is certainly something I’ve felt, often with my financial future and career. I feel this when looking at my salary or my savings and wondering if I’m doing okay compared to others. Often, I’ve compared myself to others and tried to establish a comparative metric that helps me determine if I’m doing well.

This used to be dollars, and for the most part, I’ve given up on this. Once in awhile I look at someone and think “could I be like them” or “should I try to do what they do” to achieve something similar, but I quickly look at my self of happiness, stress, and other ephemeral metrics to realize I have a great life and shouldn’t bother measuring whatever I’m observing.

From the Dictionary of Obscure Sorrows

Posted in Blog | Tagged , | Comments Off on A New Word: Addleworth

Where to Test Your Code

The last 10-15 years in software development have seen a widespread embracing of unit testing. Before the popularity of mobile phones and their apps, most of the organizations I’d worked in gave lip service to automated unit testing, and often even more complex integration/system tests.

These days, it seems more and more people embrace unit testing, and I hear about that often from customers and attendees at events. I don’t often hear about more comprehensive integration and system testing, I found an interesting article from the Pragmatic Engineer that looked at how the Bluesky social network was built. The article is partially paywalled, but I  have subscribed because of the interesting thoughts they publish. In this article, there was a really interesting part of the article on testing. This is a section titled “Integration tests over unit tests”.

This isn’t described in any detail, but there is a note that the priority is for integration tests. There are unit tests, but I’m guessing this means that they write mostly integration tests first and then perhaps fill in with unit tests. The article does note that the backend is heavy on integration tests, looking to test the flow of data through the network. I assume network means their application here.

I think a lot of companies think about skipping unit testing in the database and instead might run some sort of integration tests from the application that hit the database. At least, I hope they do this. If they use unit tests that mock the database, that’s not necessarily a great way to ensure that the things in the database work as expected. Data types, defaults, rules/constraints, etc. All of these things might be different in a database over time, which is why devs need a database that is regularly updated from production (though is likely smaller in dataset size).

I can see some value in looking at integration tests more than unit tests. If we can only test so much because of time pressures, ensuring that the flow of read/write to and from the database makes sense. Queries as well, since potentially there are writes that store data and queries that read or aggregate data that might be transformed somehow in the database. Imagine writing a field, but having queries that read from a computed column that has normalized the data somehow. Or even triggers that have changed the data.

I am a bit fan of testing, and I think there is value in database unit testing, but I also understand that many people struggled to get started there. If you aren’t going to do database unit testing, then ensure that you are running integration tests that call through to a database. I realize this can be a hassle to set up in a pipeline but building better quality software means some investment in automated testing. That requires a way to build and update dev/test databases over time. A crucial part of embracing DevOps in the database.

Steve Jones

Listen to the podcast at Libsyn, Spotify, or iTunes.

Note, podcasts are only available for a limited time online.

Posted in Editorial | Tagged | Comments Off on Where to Test Your Code

Take the SQL Saturday Topic Survey

What topics do you want to see presented at a future SQL Saturday (or other event)? Steve Rezhener has built a survey that you can take.

Take the survey today!

You don’t have to answer every question. Pick those you are interested in and leave the rest blank.

I’ve set up redirects at SQL Saturday as well:

I’ll do some analysis in a week or so of the results and publish something.

Posted in Blog | Tagged , | 1 Comment

Resetting Git and Abandoning Changes–#SQLNewBlogger

I recently had an issue in one of my Git repos, and decided to drop all my local changes and just pull down from the remote. This post looks at what I did.

Another post for me that is simple and hopefully serves as an example for people trying to get blogging as #SQLNewBloggers. You can see all posts on Git as well.

A Bad State

The old cartoon looks like this:

2024-06-17 16_35_56-Never forget _ r_git

In my case, I hadn’t done this. I didn’t have a fire, but I did leave the building.

Actually, what I’d done was made a few changes at home and hadn’t committed them. I was in between trips and in a hurry, and walked away. On the road, I made similar changes and did commit/push them. When I got home, I couldn’t git pull because of the conflict.

What’s worse, these were binary (Excel) files.

I could have tried to sort things out, but in this case, I knew the remote copy was likely more up to date in place and I could easily re-enter the data I’d saved but not committed.

The way to do this for me, for tracked changes, was git reset.

In my case, I wasn’t trying to reset to a particular commit, I just wanted to whack all changes I’d made. This was just one file for me, so I issued:

git reset -–hard

The -–hard discards changes to any tracked files. Changes to untracked files aren’t affected. I’ll write about that in another post.

This cleaned my local repo back to the last time I’d had a git pull. From here, I could just get changes from the remote and work on.

SQL New Blogger

This post took about 5 minutes, literally, to write. Some of that is I’m a good typist, some is this is a simple story. Any tech pro ought to be able to do this in 5 minutes as well. If not, learn to type or to structure a short story.

This shows a little tech knowledge, but also an explanation of a situation.

Posted in Blog | Tagged , , , | Comments Off on Resetting Git and Abandoning Changes–#SQLNewBlogger