Tag: syndicated

  • Daily Coping 12 Jan 2023

    Today’s coping tip is to write a list of things you feel grateful for and why.

    1. My wife – our relationship continues to grow, and I cherish this after more than 27 years.
    2. Health – no major issues for me
    3. Finances – secure enough to not worry, with relatively minor stresses over expenses.
    4. Children – healthy and doing well in life. I’m proud of them
    5. Coaching – I love working with kids and am grateful for the chance to do so.
    6. Animals – The dogs, cats, and horses enrich my life. I’m grateful, even when I’m annoyed by something.

    There is plenty more, but this is a short list.

    I started to add a daily coping tip to the SQL Server Central newsletter and to the Community Circle, which is helping me deal with the issues in the world. I’m adding my responses for each day here. All my coping tips are under this tag.

  • Getting Started Connecting to a Database with Flyway

    In a previous post, I got Flyway installed as a CLI utility (command line interface). This post will look at the first connection to a database.

    If you need to install Flyway on Windows, see my previous post.

    Concepts

    Flyway is a command line executable that takes various parameters to control what it does. Essentially, these are command verbs and decide what action is running. The previous post looked at the version command.

    There are also parameters that can be included before the command. There are lots of parameters.

    However, much of the way Flyway works is controlled by the flyway.conf file, which is inside a conf folder where you installed Flyway. If this file is found in the current folder, then Flyway will use configuration parameters from this file.

    Note, the inline parameters should override those in the conf file.

    Configuration

    I find it much easier to use the configuration files. While you can specify this with the configFiles parameter, I often ensure that I run Flyway from within a particular folder that has a flyway.conf file. This has worked well.

    Copy your flyway.conf from your install folder (under conf) to a new folder where you will experiment. For me, I set up a new folder called “smoketests” where I’m doing a little experimenting. As you can see, I only have two files in here:

    2022-12-27 11_06_23-cmd

    The default conf file can get a little confusing. It’s full of many options, which are somewhat documented. My default looks like this when I open it:

    2022-12-27 11_07_28-flyway.conf - flywaysimpletalk - Visual Studio Code

    Most everything is commented out, which makes it harder to figure out what to do.

    The thing to remember is that you uncomment those settings that you want to set. For example, the drivers section is extensive. Some of theses are included, some you need to download. Since this are all Java based JDBC drivers, it can look strange to a SQL Server person.

    2022-12-27 11_15_29-flyway.conf - flywaysimpletalk - Visual Studio Code

    The thing that gets lost in here for me is that I don’t comment out the line that starts with SQL Server. Instead, I need to copy and paste the jdbc part to the flyway.url= line. My valid connection would look like this:

    2022-12-27 11_17_26-● flyway.conf - flywaysimpletalk - Visual Studio Code

    Let’s try connecting with the info command. When I run Flyway info, I get asked for a user and password. Annoying, but not that bad. However, I then get an error:

    2022-12-27 11_19_53-cmd

    This is a secure connection error. I do have TCP/IP enabled, which I know Java needs. This is more about a change the SQL Server team made, which requires secure connections.

    Let’s add this to our connection string: ;trustServerCertificate=true

    This gives me this string:

    flyway.url=jdbc:sqlserver://aristotle\SQL2022;databaseName=FWPOC_1_Dev;trustServerCertificate=true

    Now when I connect, things work. I still have to enter a name and password, but I can connect and I get back something.

    2022-12-27 11_22_56-cmd

    I see some info on flyway versions. There’s a new version available. I’m also licensed for Flyway Enterprise.

    Then I see the filesystem folder, sql, is missing. This is where the migrations are stored, so if I want to add migration scripts, I need to add a folder.

    Next, I get the complete connection string. Lots of options here, of which most are defaults.

    Then I see the schema is empty. Flyway works off schemas, which is what many platforms require. We get lazy in SQL Server and often just use dbo, but most other platforms want schemas set up.

    Finally I see that there are no migrations run in this database, and I see an empty status table.

    That’s a lot, and I connected to the database. Nothing changed in the database, and no flyway_schema_history table was added. This essentially let me know Flyway was working.

    The last thing I’ll do is add this to my connection string: integratedSecurity=true

    This lets get away from the name and password on Windows, but using Windows Auth for SQL Server.

    2022-12-27 11_30_50-cmd

    That’s it. I’ll keep working on different commands in Flyway and getting to know the CLI.

  • The Database DevOps SeQueL with SQL Solutions Group

    Next week, on Jan 18, 2023, I’m doing another webinar with the SQL Solutions Group. This is the SeQueL to our first webinar on Database DevOps.

    You can register here.

    Since the first webinar, Scott has been working with clients, integrating DevOps into their software process. It’s a big change in some ways, small in others. We decided to do another webinar, discussing some of the challenges clients face in moving to a DevOps style of software development.

    Join me on Wed, Jan 18. Be sure you register for the event and set a reminder.

  • Daily Coping 11 Jan 2023

    Today’s coping tip is to do a kind act for someone else today to brighten their day

    This is one I’ve done before, but this tip reminded me to do it again.

    My wife works hard, often lots of hours, and gets stuck outside with many clients. I made it a point this week to look at her schedule and then cook lunch for her and bring it out.

    I started to add a daily coping tip to the SQL Server Central newsletter and to the Community Circle, which is helping me deal with the issues in the world. I’m adding my responses for each day here. All my coping tips are under this tag.