The StrozHusband. Father. Coder. Golfer. Gamer. Die-hard Giants fan.2024-03-13T06:00:00Zhttps://scottstroz.com/Scott StrozUsing the Oracle Cloud TypeScript SDK Part 5 - Creating a MySQL HeatWave Backup2024-03-13T06:00:00Z/posts/2024/march/typescript-oci-backup-create/<p>This post is the fifth in a series that will demonstrate how to view and manage MySQL HeatWave instances in <a href="https://www.oracle.com/cloud/">Oracle Cloud Infrastructure</a> (OCI). Oracle offers several <a href="https://docs.oracle.com/en-us/iaas/Content/API/Concepts/sdks.htm">SDKs</a> that can be used to view and manage resources in OCI. In this post, we will discuss how to leverage the...Using the Oracle Cloud TypeScript SDK Part 4 - Listing MySQL HeatWave Backups2024-02-26T06:00:00Z/posts/2024/february/typescript-oci-backup-list/<p>This post is the fourth in a series that will demonstrate how to view and manage MySQL HeatWave instances in <a href="https://www.oracle.com/cloud/">Oracle Cloud Infrastructure</a> (OCI). Oracle offers several <a href="https://docs.oracle.com/en-us/iaas/Content/API/Concepts/sdks.htm">SDKs</a> that can be used to view and manage resources in OCI. In this post, we will discuss how to leverage the...Using the Oracle Cloud TypeScript SDK Part 3 - Waiters2024-02-19T06:00:00Z/posts/2024/february/typescript-oci-sdk-waiters/<p>This post is the third in a series that will demonstrate how to view and manage MySQL HeatWave instances in <a href="https://www.oracle.com/cloud/">Oracle Cloud Infrastructure</a> (OCI). Oracle offers several <a href="https://docs.oracle.com/en-us/iaas/Content/API/Concepts/sdks.htm">SDKs</a> that can be used to view and manage resources in OCI. In this post, we will discuss how to leverage the...Using the Oracle Cloud TypeScript SDK Part 2 - Managing MySQL HeatWave Instances2024-02-16T06:00:00Z/posts/2024/february/typescript-oci-sdk-manage-instance/<p>This post is the second in a series that will demonstrate how to view and manage MySQL HeatWave instances in <a href="https://www.oracle.com/cloud/">Oracle Cloud Infrastructure</a> (OCI). Oracle offers several <a href="https://docs.oracle.com/en-us/iaas/Content/API/Concepts/sdks.htm">SDKs</a> that can be used to view and manage resources in OCI. In this post, we will discuss how to leverage the...Using the Oracle Cloud TypeScript SDK Part 1 - Listing MySQL HeatWave Instances2024-02-14T06:00:00Z/posts/2024/february/typescript-oci-sdk-list/<p>This post is the first in a series that will demonstrate how to view and manage MySQL HeatWave instances in <a href="https://www.oracle.com/cloud/">Oracle Cloud Infrastructure</a> (OCI). Oracle offers several <a href="https://docs.oracle.com/en-us/iaas/Content/API/Concepts/sdks.htm">SDKs</a> that can be used to view and manage resources in OCI. In this post, we will discuss how to leverage the...Testing MySQL Applications With Java and Testcontainers2023-12-17T06:00:00Z/posts/2023/december/testing-mysql-apps-java/<p>Over the years, I have become obsessed with writing code tests. One big pain point with writing tests is testing code that interacts with a database. In this post, we will talk about some of the difficulties encountered when writing tests for database interaction and how we can use <a href="https://testcontainers.com/">Testcontainers</a> to mitigate those issues.</p>
<h2 id="the-issues"...Parameterizing MySQL Queries in Node2023-12-12T06:00:00Z/posts/2023/december/parameterizing-mysql-node/<p>There are very few absolutes in software development. One of these would be “<em><strong>NEVER</strong> trust user input</em>”. You should never run a database query involving user input without validating, sanitizing, and parameterizing the user-provided values. If you neglect to handle user input correctly, specifically parameterizing the data, your application will be vulnerable to attack...Capturing GPS Data on a Raspberry Pi and Storing It as JSON2023-12-09T06:00:00Z/posts/2023/december/capturing-storing-gps-data/<p>In a <a href="/posts/2023/december/installing-mysql-raspberry-pi/">previous post</a>, I showed how you can install <a href="https://www.mysql.com/">MySQL</a> on a <a href="https://www.raspberrypi.org/">Raspberry Pi</a>. In this post, I will show how to capture GPS data and store that data as JSON in <a href="https://www.mysql.com/products/enterprise/document_store.html">MySQL Document...Installing MySQL Innovation Release on a Raspberry Pi2023-12-07T06:00:00Z/posts/2023/december/installing-mysql-raspberry-pi/<p>A while back, I wondered if it was possible to run <a href="https://www.mysql.com/">MySQL</a> on a <a href="https://www.raspberrypi.org/">Raspberry Pi</a>. Not only is it possible, but it is not as complicated as I expected. Read on to find out how.</p>
<h2 id="the-hardware" tabindex="-1">The Hardware</h2>
<p>The first thing I needed to do to get MySQL running on a Raspberry Pi was procure a...Applying Database Migrations in MySQL HeatWave With GitHub Actions2023-12-03T06:00:00Z/posts/2023/december/github-actions-mysql-migrations/<p>In a <a href="/posts/2023/october/github-actions-mysql-tests/">previous post</a>, I talked about how we can leverage <a href="https://github.com/features/actions">GitHub Actions</a> to automate running tests whenever a commit is made to a specific branch of a GitHub repository. In this post, we will discuss one way we can harness GitHub Actions to apply database migration scripts to a <a...Running MySQL Tests With GitHub Actions2023-10-04T06:00:00Z/posts/2023/october/github-actions-mysql-tests/<p>Recently, I have been talking about how to write and run tests for <a href="https://nodejs.org/en">Node.js</a> code that interacts with a <a href="https://www.mysql.com/">MySQL</a> database. These posts have included details on how to use third-party libraries such as <a href="https://testcontainers.com/">Testcontainers</a> to run the tests in a clean database and <a...Integrating DB Migrations Into Your MySQL Tests2023-09-21T06:00:00Z/posts/2023/september/mysql-testing-knex-testcontainers/<p>In previous posts, I discussed how we can use <a href="https://testcontainers.com/">Testcontainers</a> to more easily test <a href="/posts/2023/august/testing-mysql-apps-node/">code that interacts with a MySQL Database</a> and <a href="/posts/2023/august/testing-mysql-doc-store-apps-node/">code that interacts with MySQL Document Store</a>. In yet another post, I demonstrated <a...A Tool For Poor Typists - SendKeys2023-09-04T06:00:00Z/posts/2023/september/send-keys-intro/<p>Ask anyone who has had a conversation with me over IM or email, and they will tell you I am a horrible typist. I was never a great typist, but was much better in high school. After graduating, it would be about 13 years before I would need to type again. So, it was like learning all over again.</p>
<h2 id="the-problem" tabindex="-1">The Problem</h2>
<p>I have gotten better at typing, and...The Undefined Show - Coming Soon2023-09-01T06:00:00Z/posts/2023/september/undefiend-show-premiere/<p>I would like each and every one of you to join me and my good friends, <a href="https://recursive.codes/">Todd Sharp</a> and <a href="https://www.raymondcamden.com/">Ray Camden</a>, when we launch our new live stream, <a href="https://www.twitch.tv/theundefinedshow">The Undefined Show</a>, on September 11, 2023 at 8:00 PM Eastern. We will discuss a broad range of topics, primarily related to...Managing MySQL Database Changes with Knex2023-08-31T06:00:00Z/posts/2023/august/managing-database-changes-knex/<p>As all developers know, one of the most critical parts of any project is tracking database changes (or migrations). These changes will likely need to be applied in a particular order, and they need to be applied to every environment in the development workflow. We should also be able to roll back these changes should things not go as expected. <a href="https://knexjs.org/">Knex</a> (pronounced...Writing Tests For MySQL Document Store Apps with Node2023-08-23T06:00:00Z/posts/2023/august/testing-mysql-doc-store-apps-node/<p>In a <a href="/posts/2023/august/testing-mysql-apps-node/">previous post</a>, I talked about how we can use <a href="https://testcontainers.com/">Testcontainers</a> to help make it easier to write tests for Node applications that interact with a MySQL database. In this post, we are going to discuss how we can write tests for Node applications that interact with <a...Testing MySQL Applications With Node.js and Testcontainers2023-08-11T06:00:00Z/posts/2023/august/testing-mysql-apps-node/<p>Over the years, I have become obsessed with writing code tests. One big pain point with writing tests is testing code that interacts with a database. In this post, we are going to talk about some of the difficulties that may be encountered when writing tests for database interaction and how we can use <a href="https://testcontainers.com/">Testcontainers</a> to mitigate those issues.</p>
<h2...Moving MySQL Databases from Azure to OCI Using MySQL Shell2023-06-30T06:00:00Z/posts/2023/june/mysql-shell-dump-azure-to-oci/<p>In a <a href="posts/2023/june/mysql-shell-dump-azure-to-oci/">recent post</a> I talked about how we can move data from MySQL running in AWS to a <a href="https://www.mysql.com/cloud/">MySQL HeatWave Database</a> instance running in <a href="https://www.oracle.com/cloud/">Oracle Cloud Infrastructure</a> (OCI) with just two commands using <a...Moving MySQL Databases from AWS to OCI Using MySQL Shell2023-06-21T06:00:00Z/posts/2023/june/mysql-shell-dump-aws-to-oci/<p>In previous posts, we talked about how we can use <a href="posts/2023/may/mysql-shell-threaded-dump/">MySQL Shell to dump and load databases</a> and how we can dump data to and from <a href="/posts/2023/june/mysql-shell-dump-to-oci/">Oracle Cloud Infrastructure</a> (OCI) buckets. In this post, we are going to show how you can use <a href="https://dev.mysql.com/doc/mysql-shell/8.0/en/">MySQL...Using MySQL Shell to Dump Data To And Read Data From OCI Storage Buckets2023-06-08T06:00:00Z/posts/2023/june/mysql-shell-dump-to-oci/<p>In a <a href="posts/2023/may/mysql-shell-threaded-dump/">previous post</a>, we discussed how you could use <a href="https://dev.mysql.com/doc/mysql-shell/8.0/en/">MySQL Shell</a> to dump and load data using a multithreaded process. At the end of the post, I mentioned it was possible to dump data to and load data from cloud services such as <a href="https://www.oracle.com/cloud/">Oracle Cloud...Multithreaded Data Dumps With MySQL Shell2023-05-22T06:00:00Z/posts/2023/may/mysql-shell-threaded-dump/<p><a href="https://dev.mysql.com/doc/mysql-shell/8.0/en/">MySQL Shell</a> is a powerful command line interface for connecting to and managing <a href="https://www.mysql.com/">MySQL</a> instances. One feature of MySQL Shell’s <a href="">Admin API</a> is being able to dump specific tables (or a subset of data in a table), dump one or more complete schemas, or dump an entire database instance and...Connecting to a MySQL HeatWave Database Instance Using OpenVPN2023-04-26T06:00:00Z/posts/2023/april/mysql-database-access-openvpn/<p><a href="https://docs.oracle.com/en-us/iaas/mysql-database/doc/overview-mysql-database-service.html">MySQL HeatWave Database</a> is a fully managed service on <a href="https://www.oracle.com/cloud/">Oracle Cloud Infrastructure (OCI)</a> that is developed, managed, and supported by the MySQL team at Oracle. When you provision a new MySQL instance under OCI, you can only connect to the database...Using Aggregate Functions With MySQL Document Store2023-04-12T06:00:00Z/posts/2023/april/doc-store-aggregate/<p><a href="https://www.mysql.com/products/enterprise/document_store.html">MySQL Document</a> Store is a JSON document storage solution built on MySQL. One of the advantages of using MySQL Document Store for JSON document storage is when we need to run complex queries for analytics or reporting we can use raw SQL to retrieve data from our JSON documents. But what if we want to view basic aggregate...Viewing MySQL Document Store Queries in MySQL Database Services2023-03-30T06:00:00Z/posts/2023/march/document-store-queries-mds/<p>In a <a href="/posts/2023/february/document-store-under-the-covers/">previous post</a>, we talked about how you can view the underlying queries that are run when we make calls to the <a href="https://www.mysql.com/products/enterprise/document_store.html">MySQL Document Store</a> API. While this solution works well on a local or other on-premise instance of MySQL, it is not a viable option for...Using OCI Alarms to Detect When a MySQL Instance Is Unavailable2023-03-15T06:00:00Z/posts/2023/march/using-oci-alrams-mds/<p><a href="https://docs.oracle.com/en-us/iaas/mysql-database/doc/overview-mysql-database-service.html">MySQL Database Service (MDS)</a> is a fully-managed <a href="https://www.oracle.com/cloud/">Oracle Cloud Infrastructure (OCI)</a> service that allows you to harness the ease and power of MySQL in the cloud. Since MDS is deployed to OCI, we can take advantage of <a...Connecting to a MySQL HeatWave Database Instance Using an OCI Network Load Balancer2023-02-06T06:00:00Z/posts/2023/february/myql-database-service-over-internet/<p><a href="https://docs.oracle.com/en-us/iaas/mysql-database/doc/overview-mysql-database-service.html">MySQL HeatWave Database</a> is a fully managed service on <a href="https://www.oracle.com/cloud/">Oracle Cloud Infrastructure (OCI)</a> that is developed, managed, and supported by the MySQL team at Oracle. When you provision a new MySQL instance under OCI, you can only connect to the database...MySQL Document Store - Peeking Under the Covers2023-02-02T06:00:00Z/posts/2023/february/document-store-under-the-covers/<p><a href="https://www.mysql.com/products/enterprise/document_store.html">MySQL Document Store</a> is a ‘NoSQL’ solution built on top of <a href="https://www.mysql.com/">MySQL</a>. Last month, I gave a talk at <a href="https://that.us/events/tx/2023/">THAT Conference</a> about using <a href="https://that.us/activities/M866zZfqVqnKiErwIUOh">MySQL Document Store with Node.js</a>. During that talk,...Functional Indexes in MySQL2023-01-12T06:00:00Z/posts/2023/january/functional-indexes-mysql/<p>Database indexes are used to help query performance. Database indexes typically contain information about data in a specific column of the database table. With the introduction of <a href="https://dev.mysql.com/doc/refman/8.0/en/create-index.html#create-index-functional-key-parts">functional indexes</a> in <a href="https://www.mysql.com/downloads/">MySQL</a> 8.0.13, we can now create indexes...Indexing JSON Data in MySQL2023-01-10T06:00:00Z/posts/2023/january/indexing-json-mysql/<p>Storing JSON in a relational database is something developers have done for quite some time. There are a variety of reasons why you would want to store JSON in a database table - user preferences and configuration data are two good examples. The <a href="https://dev.mysql.com/doc/refman/8.0/en/json.html">JSON Data Type</a> was introduced to MySQL in version 5.7.8. This data type allows us to...Creating Aliases In MySQL Shell2022-10-17T06:00:00Z/posts/2022/october/customize-mysql-shell/<p><a href="https://dev.mysql.com/doc/mysql-shell/8.0/en/">MySQL Shell</a> is a powerful way to connect to and manage <a href="https://www.mysql.com/">MySQL</a> instances. Connections can even be made to servers that are behind an SSH connection. In this post, we will discuss how to extend and customize MySQL Shell so that it is easier to initiate those connections.</p>
<h2 id="the-problem"...Indexing Data in MySQL Document Store2022-10-07T06:00:00Z/posts/2022/october/mysql-document-store-indexes/<p><a href="https://www.mysql.com/products/enterprise/document_store.html">MySQL Document Store</a> is a JSON document storage solution built on top of <a href="https://www.mysql.com/">MySQL</a>. One feature of MySQL Document Store that can help speed up searches is the ability to create indexes of data contained within our JSON documents. In this post, we will demonstrate creating an index and...Importing a MongoDB Into MySQL Document Store with MySQL Shell2022-09-22T06:00:00Z/posts/2022/september/import-mongodb-to-mysql-document-store/<p><a href="https://www.mysql.com/products/enterprise/document_store.html">MySQL Document Store</a> is a “NoSQL” database built on top of <a href="https://www.mysql.com/">MySQL</a>.
The <a href="https://dev.mysql.com/doc/x-devapi-userguide/en/">X Dev API</a> provides basic CRUD operations that allow developers to manage JSON document collections.
In this post, we will talk about how we can import...Connecting MySQL Shell Over SSH2022-09-12T06:00:00Z/posts/2022/september/mysql-shell-ssh/<p>As I mentioned in my <a href="/posts/2022/september/mysql-shell-alias/">last post</a>, I am a big fan of <a href="https://dev.mysql.com/doc/mysql-shell/8.0/en/">MySQL Shell</a>. Until recently, I have only used MySQL Shell to connect to a local instance of MySQL running on my development machine.</p>
<p>I recently needed to connect to a MySQL database running on a remote server. I wanted to use...MySQL Shell Alias For PowerShell2022-09-09T06:00:00Z/posts/2022/september/mysql-shell-alias/<p>Yesterday, my colleague, <a href="https://lefred.be/">Fred (AKA LeFred)</a>, shared a <a href="https://lefred.be/content/always-use-mysql-shell/">blog post</a> that discusses setting up aliases that allow us to run <a href="https://dev.mysql.com/doc/mysql-shell/8.0/en/">MySQL Shell</a> when we enter <code>mysql</code> at a command prompt.</p>
<p>Since I also use Windows regularly, I wanted to...MySQL Window Functions Part 22022-09-08T06:00:00Z/posts/2022/september/mysql-window-functions-2/<p>First introduced as part of the SQ:2003 Standard and available in MySQL 8.0, window functions in MySQL are compelling, but the syntax can also be a little intimidating when you first start using them. This post is the second in a series where we will discuss window functions – including breaking down the syntax and using examples of different window functions. All the code examples in this post...Heading to Raleigh in November2022-09-06T06:00:00Z/posts/2022/september/ato-conference-announcement/<p>I am excited to announce that I am speaking at <a href="https://2022.allthingsopen.org/">All Things Open</a> this year.</p>
<p>The conference is November 1-2 in Raleigh, NC.</p>
<p>In <a href="https://javascript-conference.com/node-js/my-tests-passed-but-why-did-my-code-fail/">my session</a> I will talk about how to use <a href="https://nodejs.org/">Node.js</a> with <a...Speaking in NYC This Month2022-09-02T06:00:00Z/posts/2022/september/ijs-conference-announcement/<p>I am speaking at the <a href="https://javascript-conference.com/new-york/">International JavaScript Conference</a> at the end of this month in Brooklyn, NY.</p>
<p>You may be wondering what MySQL has to do with JavaScript. Well, in <a href="https://javascript-conference.com/node-js/my-tests-passed-but-why-did-my-code-fail/">my session</a> I will talk about how to use <a...MySQL Window Functions Part 12022-09-01T06:00:00Z/posts/2022/september/mysql-window-functions-1/<p>First introduced as part of the SQ:2003 Standard and available in MySQL 8.0, window functions in MySQL are compelling, but the syntax can also be a little intimidating when you first start using them. This post is the first in a series where we will discuss window functions – including breaking down the syntax and using examples of different window functions.</p>
<h2 id="definition"...Where Have I Been?2022-08-29T06:00:00Z/posts/2022/august/where-have-i-been/<p>If it seems like this space was neglected for a while, well…that is because it was.</p>
<p>I started blogging again because I wanted to continue giving back to the communities I have been a part of for many years. My way of 'paying it forward, if you will.</p>
<p>I had aspirations to share content regularly, but unfortunately, life got in the way.</p>
<p>Back in late April, I got COVID. It was...Better Tests Part 2 - Test Every Condition2022-04-29T06:00:00Z/posts/2022/april/better-tests-02/<p>This is the second part of a series of posts that will help us write better tests…and this one should seem kind of obvious - making sure we test every logical condition in our code.</p>
<h2 id="umm%E2%80%A6duh%E2%80%A6" tabindex="-1">Umm…duh…</h2>
<p>You might be thinking that this is something that might not need to be covered, but, when you have some complex logic inside the methods you are...Better Tests Part 1 - Static Data2022-04-05T06:00:00Z/posts/2022/april/better-tests-01/<p>This is the first part in a series of posts that will help us write better tests…and this is a big one for me - the use of static data in our tests. Keep in mind that while the sample code below is written in JavaScript, the concept would be the same in any language.</p>
<h2 id="avoid-static-data-where-you-can" tabindex="-1">Avoid Static Data Where You Can</h2>
<p>There may be some people who...EMS & Coding - Shared Skills2022-03-29T06:00:00Z/posts/2022/march/shared-skills/<p>Many people close to me (and quite a few who are not that close) know that before I started my career as a developer I worked as a paramedic for almost 15 years. When my family and I left New Jersey in 2004, it was the first time in almost 20 years (dating back to when I was 16) that I did not have a job in the medical profession. I often get asked how I made the switch from being a paramedic...Verifying Code Coverage With Karma2022-03-24T06:00:00Z/posts/2022/march/karma-coverage/<p>This is the first in a <a href="/tags/bettertests">series of posts</a> that will help ease the transition to TDD and how we can make sure we write tests that actually verify the code we write is correct.</p>
<h2 id="what-is-coverage%3F" tabindex="-1">What is coverage?</h2>
<p>In this post, we are going to talk about something that is probably more useful if you already have code that you want...Conference Announcement2022-03-17T06:00:00Z/posts/2022/march/conference-announcement/<p>I am thrilled that I was selected to speak at the <a href="https://www.javascriptandfriends.com/">JavaScript & Friends Conference</a> in Columbus, OH on July 29th.</p>
<p>I will be helping attendees understand the importance of writing tests for our code, how to identify what needs to be tested, how we go about writing the tests, and some guidelines for writing tests that ensure our code is...Hello, World (again)2022-03-16T06:00:00Z/posts/2022/march/helloworld/<p>I would like to welcome you to my little slice of the Interwebs.</p>
<p>You may be wondering why I said ‘again’. Well, that is because is the second incarnation of my blog. I had technical issues with the older version and, well, life kind of got in the way of correcting those issues. To be honest, a lot of the content is old and not likely relevant any longer. I do plan on going through the...