Giter Club home page Giter Club logo

ssdt-continuous-deployment-project-template-helpers's Introduction

datapatch-wrapper

SSDT-Continuous-Deployment-Project-Template-Helpers

GitHub release Build status GitHub

This is a Visual Studio extension that add some helpers to the SSDT-Continuous-Deployment-Project-Template

  • A quick wrapper command for datapatches
  • A change promoter of common datapatches in two flavors
    • adding automatic references to all files
    • providing a configuration UI where the user can choose the promotion destinations

The quick wrapper command for datapatches

In order to capture changes into the migration table a datapatch should be applied through sp_execute_cd_script. Using the quick wrapper the user can create a datapatch as a plain script with DML statements (INSERT/UPDATE/DELETE) and transform it as parameter to sp_execute_cd_script

datapatch-wrapper

Constraints to qualify for wrapping

  • the file must be opened in the current document tab
  • the file must be part of a SSDT Database project
  • the file should have a sql extension
  • the file must have DML statements (INSERT/UPDATE/DELETE)
  • if it was wrapped already it will not be applied twice

The change promoter of common datapatches to sibling folders that aggregates the fixes for different deployments

If the base schema is distributed to several independent databases, this tool will help promoting the datapatch to several sibling folders. It will help to add a SQLCMD reference of the selected script to the needed matching destinations.

How it works

It works with two naming conventions:

  1. A file that is matching "*.all.sql" will be promoted to all sibling files matching "*.main.datapatch.sql"
  2. A file that is matching "*.sub.sql" will provide a configuration UI where the user can choose the destination files matching "*.main.datapatch.sql"

Promoting "*.all.sql" files.

Demo

changepromoter-howto

Constraints for a valid ALL promotion

  • the subject to promotion must match "*.all.sql"
  • the subject to promotion must be a sql script
  • the subject to promotion must have the "Build Action" as "None"
  • the destination file must match "*.main.datapatch.sql"
  • the destination file must be in a folder of the same level as the subject

changepromo-hier

Promoting "*.sub.sql" files.

Demo

changepromoter-with-sub

Constraints for a valid FILTERED SUBset promotion

  • the subject to promotion must match "*.sub.sql"
  • the subject to promotion must be a sql script
  • the subject to promotion must have the "Build Action" as "None"
  • the destination file must match "*.main.datapatch.sql"
  • the destination file must be in a folder of the same level as the subject
  • the destination file must be checked in the "Destination Picker" dialog box

Advantages

  • the destination files collection can be saved and reused
  • alows filtered subset of destination files
  • all the files can be checked in a single action
  • the "all" collection is protected from changes
  • the configuration setup is saved as json file
  • the configuration collection are persisted in the current session of VS

Requirements

  1. SSDT Tools ssdt-installed
  2. A database project created from the template provided by SSDT-Continuous-Deployment-Project-Template

Installation

Install from the Visual Studio Marketplace

Demo solution

A demo database project structure can be downloaded from https://github.com/matei-tm/SSDT-Continuous-Deployment-Project-Template-Helpers/tree/develop/examples/SSDT-CICD-Demo

Changelog

Please see project's changelog

Disclaimer

Important: This extension, being a code generator, will change files in the targeted database project. Use a suitable source control system (eg, git) to protect your code from transient changes.

The datapatch wrapper module updated files

The helper updates, in the current SSDT project, the current sql file opened in the editor tab of Visual Studio

The change promoter updated files

The helper updates, in the current SSDT project, all the files matching the pattern "*.main.datapatch.sql" contained in all the folders that are at the same level (siblings) as the folder that contains the "*.all.sql" file (the file used for the promotion).

Although I should not overwrite any file, other than those mentioned, during this process, I do not provide any warranty or take any responsibility for the loss of data.

ssdt-continuous-deployment-project-template-helpers's People

Contributors

matei-tm avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.