From e81b0517799b85a749f5e8d9d6c6b8a6315dfa18 Mon Sep 17 00:00:00 2001 From: Edwin Young Date: Sat, 19 Sep 2015 13:50:04 -0700 Subject: [PATCH] Update readme.md from the one in prequel-pages --- README.md | 46 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 491a501..682eb41 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,48 @@ -# Prequel +--- +title: Prequel +layout: default +--- [![Build status](https://ci.appveyor.com/api/projects/status/ebtg15yc3wls89yi/branch/master?svg=true)](https://ci.appveyor.com/project/edyoung/prequel/branch/master) +# Prequel. + +Prequel was born out of working on a product which contains a large number of database schemas and stored procedures. +Every so often, a really basic error would be accidentally committed to the repository - sometimes, the SQL had syntax errors. +This wasn't caught until tests were run, which seemed wasteful. So I wanted a tool I could run on plain .sql files +and integrate into the build system so that it would catch syntax errors and other errors earlier. + +## Basic Usage +Say you have a file foo.sql which contains: + + create procedure sp_foo as + declare @myvar as int + set @mvar = 2 + go + +You can run prequel like so: + + PS C:\> .\Prequel.exe /warn:3 foo.sql + +And it will print out + + Prequel version 0.1.0.0 + Warnings: + c:\temp\foo.sql(1) : WARNING 4 : Procedure sp_foo should not be named with the prefix 'sp_' + c:\temp\foo.sql(3) : WARNING 1 : Variable @mvar used before being declared + c:\temp\foo.sql(1) : WARNING 3 : Procedure sp_foo does not SET NOCOUNT ON + c:\temp\foo.sql(2) : WARNING 2 : Variable @myvar declared but never used + +## Installation and prerequisites. + +Prequel requires the Microsoft SQL Server 2014 Transact-SQL ScriptDom package, which can be found on +[http://www.microsoft.com/en-us/download/details.aspx?id=42295](http://www.microsoft.com/en-us/download/details.aspx?id=42295). +Click Downlaod and choose the SqlDom.msi installer. To install Prequel itself, just unpack the .zip somewhere on your path. +Note that even if you want to target an earlier version of SQL, you still want the 2014 ScriptDom package. + +## Status +The tool works, but is unpolished and has a very small set of cases that it will detect so far. +It works only on Windows, and only supports Microsoft SQL Server's T-SQL dialect of SQL. + -A tool for linting SQL files for Microsoft SQL Server. Not functional yet. -The intended use is to capture simple SQL programming errors at compile time, before the SQL is presented to a real database.