John Liu Blog

Every drop counts

SQL Formatter

To format SQL query to your specific style, we can utilise combination of SQLFluff and Python code without built a SSM extension. How the single-step pipeline works Step 1 (SQLFluff Python API): Formats your .sql file deterministically (casing, leading commas, ON breaks, CASE blocks) Step 2 (AST Join-Tree Indenter via sqlglot): Parses the FROM clause, checks which table alias each JOIN … ON references (e.g., LC references L, B references LC), and automatically indents that entire JOIN + ON block one tab deeper under its parent table.

Azure App Service and GitHub integration config

To enable CI/CD using GitHub and Azure App Service, follow are the configuration steps: In Microsoft Entra ID –> App registrations, register an app for your above app. go to Certificates & secrets –> Federated credentials, Add credential and choose GitHub Actions deploying Azure resources. Fill out your organization, repository, and branch/environment details to establish the trust link. If have trouble fill in the GitHub details, add any dummy data for now and can comeback to correct later.

SQL Agent Maintenance Plan

SQL Agent Maintenance Plan runs SSIS package. When troubleshooting maintenance plan job error, following query might help to view detailed error message as the job history might not contain these information. SELECT TOP 20 * FROM msdb.dbo.sysmaintplan_logdetail ORDER BY start_time DESC;

Git Cheatsheet

git branch This command lists all your local branches. Your current branch will have an asterisk (*) next to it. Local branches only: git branch Remote branches only: git branch -r All local and remote branches: git branch -a On Git version 2.22+, you can use git branch --show-current to explicitly show the current branch git status This command shows any uncommitted file changes or sync status with remote server.

MIFE Win98 Gest VM Getup

To run MIFE (v1) on morden hardware, Win98 VM setup requires a few special configs when create the VM in Ubuntu 18.04.5. Machine Type When creating the VM, check the option to custom the config before install OS. The IDE option is missing from the dropdown menu because your virtual machine is currently set to use a modern Q35 Chipset (Machine Type). The Q35 architecture does not natively support the legacy IDE bus.