/website_source/index.txt
Plain Text | 116 lines | 79 code | 37 blank | 0 comment | 0 complexity | 56bb38b2f5bcfff7c555958df8111817 MD5 | raw file
Possible License(s): BSD-3-Clause
1A parser, pretty printer, and type checker for SQL written in 2Haskell. Supports PostgreSQL SQL and PL/pgSQL syntax. BSD licensed. 3 4Purpose 5======= 6 7Possible uses of this library include: 8 9* type-checker can help with SQL development and catch bugs which 10 aren't statically detected by Postgres 11* generating SQL code programmatically/ generating SQL from some other 12 source 13* transforming SQL code, possibly using quasiquoting, e.g. writing 14 PL/pgSQL with less boilerplate, or optimisation rewrites 15* viewing the catalog produced by some SQL code 16 17With some extra work: 18 19* generating documentation for SQL code 20* support running one dialect of SQL on a different DBMS using 21 automatic translation - portable SQL 22* typesafe database access from Haskell 23* lint or semantic analysis for SQL or PL/pgSQL 24 25Status 26====== 27 28Pre-alpha. Support for parsing SQL is patchy, but not too 29bad. Supports queries/DML and DDL. Here is an extract from the parsing 30tests which gives some examples of what can currently be parsed: 31 32* [Parsing examples](ParserTests.html) 33 34The type checker is currently still being fixed after some reworking 35of parsing and ast types. It should handle a lot of queries and dml 36fine though. 37 38Extract from the type checking tests: 39 40* [Type-checking examples](TypeCheckTests.html) 41 42Currently limited support for quasiquoting, here are the extracts from 43the tests: 44 45* [Quasiquotation examples](QuasiQuoteTests.html) 46 47The pretty printer should support everything the parser supports 48(i.e. it pretty prints code which both the parser and Postgres 49understand). 50 51Catalog information is limited, supports the type checking. Some 52information is collected on scalar types, domains, composite types, 53casts, tables, views and functions. 54 55Installation 56============ 57 58This project is currently developed on GHC 7.2.1. 7.0.x should be 59fine, 6.12.x might take a small amount of work. 60 61To install use 62 63~~~~~{.sh} 64cabal install hssqlppp 65~~~~~ 66 67Documentation 68============= 69 70[Haddock docs](haddock/index.html) 71 72[Examples](examples.txt.html) 73 74[Some notes on hacking on hssqlppp itself](devel.txt.html) 75 76Links 77===== 78 79Homepage: <http://jakewheat.github.com/hssqlppp/> 80 81Hackage: <http://hackage.haskell.org/package/hssqlppp> 82 83Repository: <https://github.com/JakeWheat/hssqlppp> 84 85Changes: <https://github.com/JakeWheat/hssqlppp/blob/master/CHANGES> 86 87Reporting issues and feature requests 88===================================== 89 90Use the github issue tracker. Please supply an example of SQL which 91doesn't parse/typecheck correctly where relevant. 92 93<https://github.com/JakeWheat/hssqlppp/issues> 94 95 96Provisional future plans 97======================== 98 99* parameterized statements/typesafe haskell access 100* some simple syntax extension support for SQL 101* a 'compiler' command to help developing SQL 102* parse most Postgres syntax, possibly other SQL dialects as well 103* improve the typechecker - fix current regressions, get more sql type 104 checking correctly 105* improve the catalog - add more checking, more item types 106* improve the quasi-quoting - is a bit ad hoc and limited at the moment 107* documentation generator for SQL codebases 108 109Contact 110======= 111 112Let me know if you're using/ interested in using the library, if you 113have any problems, bug reports, or suggestions, etc.. All 114contributions, comments and criticism welcome: 115 116jakewheatmail@gmail.com