Skip to content

Commit

Permalink
Update readme.md from the one in prequel-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Edwin Young committed Sep 19, 2015
1 parent 7c81192 commit e81b051
Showing 1 changed file with 43 additions and 3 deletions.
46 changes: 43 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit e81b051

Please sign in to comment.