The hssqlppp package

[Tags: bsd3, library]

Sql parser, pretty printer and type checker, targets PostgreSQL SQL and PL/pgSQL, uses Parsec and UUAGC.

Overview:

see the module Ast for the ast types;

Parser for converting text to asts;

PrettyPrinter for converting asts to text;

AnnotateSource for pretty printing annotations inline with original source;

TypeChecker for type checking and annotating asts and working with annotated trees;

SqlTypes for the data types which represent SQL types, the data type for type errors, and some support functions;

Annotation for the annotation data types and utilities;

Environment to read a catalog from a database to type check against, or to generate catalog information;

DatabaseLoader for the beginnings of a routine to load SQL into a database (e.g. to generate an ast then load it into a database without loading it via psql). The loader just about does the job but error handling is a bit crap at the moment.

CommandComponents for the component functions used in the HsSqlSystem exe.

ChaosExtensions for the experimental plpgsql syntax extensions.

Comes with command line access to some functions via a exe called HsSqlSystem, run this file with no arguments to get some help. Has a HUnit test suite which you can run using the HsSqlSystem executable. for the time being you can look at the source of this command to see what it can do:

http://bazaar.launchpad.net/~jakewheat/hssqlppp/trunk/annotate/head:/HsSqlSystem.lhs

See the project page https://launchpad.net/hssqlppp for more information and documentation links.

The test files for parsing and for type checking contain examples of what parses/ typechecks and what the asts and annotations look like:

http://bazaar.launchpad.net/~jakewheat/hssqlppp/trunk/annotate/head:/Database/HsSqlPpp/Tests/ParserTests.lhs

http://bazaar.launchpad.net/~jakewheat/hssqlppp/trunk/annotate/head:/Database/HsSqlPpp/Tests/TypeCheckTests.lhs


[Skip to ReadMe]

Properties

Versions0.0.4, 0.0.5, 0.0.6, 0.0.7, 0.0.8, 0.0.9, 0.0.10, 0.1.0, 0.2.0, 0.3.0, 0.3.1, 0.4.0, 0.4.1, 0.4.2
Change logNone available
Dependenciesbase (==4.*), cmdargs, containers, directory, filepath, haskell-src-exts, haskell98, HDBC, HDBC-postgresql, HUnit, mtl, parsec (>=3), Pipe, pretty, pretty-show, process, regex-posix, syb, template-haskell, test-framework, test-framework-hunit, uniplate [details]
LicenseBSD3
CopyrightCopyright 2009 Jake Wheat
AuthorJake Wheat
Maintainerjakewheatmail@gmail.com
Stabilitypre-alpha
CategoryDatabase
Home pagehttps://launchpad.net/hssqlppp
Bug trackermailto:jakewheatmail@gmail.com
ExecutablesHsSqlSystem
UploadedWed Jan 13 23:59:41 UTC 2010 by JakeWheat
DistributionsNixOS:0.4.2
Downloads2319 total (108 in last 30 days)
Votes
0 []
StatusDocs not available [build log]
All reported builds failed as of 2015-06-01 [all 2 reports]

Modules

Downloads

Maintainers' corner

For package maintainers and hackage trustees

Readme for hssqlppp-0.1.0

Summary: A parser, pretty printer, and type checker for PostgreSQL SQL
and PL/pgSQL. BSD licensed.

** Some of the documentation here and in the other files is out of
   date, will be updated before the first alpha release. Please email
   me (address below) if you have any questions in the meantime **

The current aims of the project is to provide a parser and type
checker for a substantial portion of PostgreSQL SQL and PL/pgSQL, and
then hopefully to build on this to make tools and libraries to help
developing PL/pgSQL code.

Status: it successfully parses and accurately pretty prints the three
moderate sized SQL files from another project of mine, but there are
lots of missing bits. Coverage of SQL is sort of reasonable - it's
possible that your SQL files will parse ok, but it's also possible
that they won't parse at all. Please report any sql which doesn't
parse.

It also has the beginnings of a type checker, which currently can type
check a fair bit of the three files mentioned above. You can run the
type checker on your SQL in various ways from the command line. Please
report any sql which doesn't type check correctly. Coming soon: a
command to produce a report on how well this code can parse and type
check your sql.

It comes with a small test suite.

To install, use
cabal update
then
cabal install hssqlppp

I think it should work on all GHC 6.10.x and possibly also GHC 6.8.x,
YMMV. GHC 6.12.x untested so far.

There are more doc files in the docs/ folder, and you can view the
haddock docs on hackage (see below for link). Better documentation is
coming soon.

The main dependencies of this project are: Parsec 3, HUnit, HDBC,
UUAGC. You currently need PostgreSQL installed.

================================================================================

Homepage

There isn't really a homepage or website yet, but you can view the
Launchpad page where the code is hosted, and the HackageDB page.

Launchpad:
http://launchpad.net/hssqlppp/

HackageDB page:
http://hackage.haskell.org/package/hssqlppp
You can also browse the limited Haddock documentation online here.

You can get the latest development code from Launchpad using Bazaar:
bzr branch lp:~jakewheat/hssqlppp/trunk

To get a snapshot release, see the downloads on the Launchpad page, or
use cabal install.


================================================================================

Contact

Let me know if you're using/ interesting in using the library, if you
have any problems or suggestions, etc.. All contributions, comments
and criticism welcome:

jakewheatmail@gmail.com

You can also report problems on the bug tracker on Launchpad.

================================================================================

= Some provisional future plans:

* use this system to develop a Lint-type checker for PL/pgSQL;

* provide support to help developing SQL from an IDE (targeting Emacs
  mainly)

* support type checking simple SQL statements that you'd embed in
  Haskell code, including with ? placeholders, to support generating
  type safe wrappers - could integrate with MetaHDBC?;

* possibly a lightweight code generation/ simple macro support to help
  with developing more robust PL/pgSQL code.

* documentation generation