Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 167 lines (125 sloc) 5.794 kb
f23bf1e got new file arrangement compiling
Jake Wheat authored
1 Summary: A parser, pretty printer, and type checker for PostgreSQL SQL
88c0429 fixed some error handling, particularly in type checking where type
Jake Wheat authored
2 and PL/pgSQL. BSD licensed.
3
005c9a3 @JakeWheat work on todo
authored
4 ** Most of the documentation here and in the other files is out of
5 date, will be updated before next relase **
6
34c61ab fixes to docs
Jake Wheat authored
7 The current aims of the project is to provide a parser and type
f23bf1e got new file arrangement compiling
Jake Wheat authored
8 checker for a substantial portion of PostgreSQL SQL and PL/pgSQL.
2a49cf8 add extension_system design, sort out README
Jake Wheat authored
9
10 Status: it successfully parses and accurately pretty prints the three
88c0429 fixed some error handling, particularly in type checking where type
Jake Wheat authored
11 moderate sized SQL files from another project of mine, but there are
333619b work on api, haddock, comments
Jake Wheat authored
12 lots of missing bits. Coverage of SQL is reasonable - it's possible
13 that your SQL files will parse ok, but it's also possible that they
e149d4a @JakeWheat add aliases for typehecking functions to minimise api breakage from
authored
14 won't parse at all. Please report any sql which doesn't parse.
2a49cf8 add extension_system design, sort out README
Jake Wheat authored
15
5f16b6b work on docs
Jake Wheat authored
16 It also has the beginnings of a type checker, which currently can type
17 check a large subset of expressions and selects that the parser can
333619b work on api, haddock, comments
Jake Wheat authored
18 parse, and some aspects of all of the DDL statements that parse, but
19 is in an early state. You can run the type checker on your SQL in
e149d4a @JakeWheat add aliases for typehecking functions to minimise api breakage from
authored
20 various ways from the command line, see the 'usage' file for
21 details. Please report any sql which doesn't type check correctly.
34c61ab fixes to docs
Jake Wheat authored
22
23 It comes with a small test suite.
24
c9e1839 few doc fixes, few comment fixes so haddock can complete
Jake Wheat authored
25 It is Cabal-installable, run:
26 cabal update
27 then
28 cabal install hssqlppp
cf4ce06 tidying up comments, documentation, and a bit of unused code deletion
Jake Wheat authored
29 to install the libraries and HsSqlSystem executable (and the test
30 runner executable), if you want to try the utilities out, or run
c9e1839 few doc fixes, few comment fixes so haddock can complete
Jake Wheat authored
31 cabal unpack hssqlppp
32 to download and view the source code easily.
33
34 I think it should work on all GHC 6.10.x and possibly also GHC 6.8.x.
2a49cf8 add extension_system design, sort out README
Jake Wheat authored
35
ca573ec tidy some docs
Jake Wheat authored
36 See the file 'development' for some notes on how to work with the
98b9a01 spelling fixes
Jake Wheat authored
37 source.
2a49cf8 add extension_system design, sort out README
Jake Wheat authored
38
333619b work on api, haddock, comments
Jake Wheat authored
39 The main dependencies of this project are: Parsec 3, HUnit, HDBC,
e149d4a @JakeWheat add aliases for typehecking functions to minimise api breakage from
authored
40 UUAGC. You currently need PostgreSQL installed.
2a49cf8 add extension_system design, sort out README
Jake Wheat authored
41
42 ================================================================================
43
5f16b6b work on docs
Jake Wheat authored
44 Homepage
2a49cf8 add extension_system design, sort out README
Jake Wheat authored
45
333619b work on api, haddock, comments
Jake Wheat authored
46 There isn't really a homepage or website yet, but you can view the
47 Launchpad page where the code is hosted, and the HackageDB page.
9ab8586 more work on docs
Jake Wheat authored
48
333619b work on api, haddock, comments
Jake Wheat authored
49 Launchpad:
50 http://launchpad.net/hssqlppp/
2a49cf8 add extension_system design, sort out README
Jake Wheat authored
51
c9e1839 few doc fixes, few comment fixes so haddock can complete
Jake Wheat authored
52 HackageDB page:
53 http://hackage.haskell.org/package/hssqlppp
333619b work on api, haddock, comments
Jake Wheat authored
54 You can also browse the limited Haddock documentation online here.
55
56 You can get the latest development code from Launchpad using Bazaar:
57 bzr branch lp:~jakewheat/hssqlppp/trunk
58
59 To get a snapshot release, see the downloads on the Launchpad page, or
60 use cabal install.
c9e1839 few doc fixes, few comment fixes so haddock can complete
Jake Wheat authored
61
5f16b6b work on docs
Jake Wheat authored
62 Contact
2a49cf8 add extension_system design, sort out README
Jake Wheat authored
63
5f16b6b work on docs
Jake Wheat authored
64 Let me know if you're using/ interesting in using the library, if you
65 have any problems or suggestions, etc.. All contributions, comments
ef80a80 add basic type for create table
Jake Wheat authored
66 and criticism welcome:
2a49cf8 add extension_system design, sort out README
Jake Wheat authored
67
5f16b6b work on docs
Jake Wheat authored
68 jakewheatmail@gmail.com
2a49cf8 add extension_system design, sort out README
Jake Wheat authored
69
cf4ce06 tidying up comments, documentation, and a bit of unused code deletion
Jake Wheat authored
70 You can also report problems on the bug tracker on Launchpad.
ef80a80 add basic type for create table
Jake Wheat authored
71
5f16b6b work on docs
Jake Wheat authored
72 ================================================================================
2a49cf8 add extension_system design, sort out README
Jake Wheat authored
73
74 = Syntax supported/ not supported:
c4fe705 added readme, todo, license
Jake Wheat authored
75
5f16b6b work on docs
Jake Wheat authored
76 == Parsing
77
c4fe705 added readme, todo, license
Jake Wheat authored
78 Partially supports:
061599b hopefully use jargon: alias, correlation name, qualified, with a bit
Jake Wheat authored
79 select statements (selectlists (*, qualified, aliased/correlation names, expressions)
87bf41d readme updates
Jake Wheat authored
80 distinct, basic window functions,
c869e96 fix some documentation
Jake Wheat authored
81 from (with explicit joins - natural, inner, cross, left, right,
87bf41d readme updates
Jake Wheat authored
82 full outer, on and using), aliases, from functions
83 where, group by, having, order by, limit, offset
e6c3c48 split sql and plpgqsl parsers
Jake Wheat authored
84 except, intersect, union
85
86 expressions: subselects, in, row ctors, strings + dollar strings,
87 integers, case, exists, boolean literals, null, arrays
88 and subscripting (slightly limited), function calls,
66ecc43 some updates to readme file
Jake Wheat authored
89 identifiers, cast(x as y), between (quite limited),
90 substring(x from a for b)
e6c3c48 split sql and plpgqsl parsers
Jake Wheat authored
91
66ecc43 some updates to readme file
Jake Wheat authored
92 also partially supports:
87bf41d readme updates
Jake Wheat authored
93 insert (with multiple values and select support), update, delete (all
94 three with returning)
ca573ec tidy some docs
Jake Wheat authored
95 create and drop table, type, view, domain
96 create function for sql and plpgsql functions
87bf41d readme updates
Jake Wheat authored
97 all constraint types
66ecc43 some updates to readme file
Jake Wheat authored
98 sort of skips copy statements instead of erroring
e6c3c48 split sql and plpgqsl parsers
Jake Wheat authored
99
100 plpgsql statements:
101 select into
c4fe705 added readme, todo, license
Jake Wheat authored
102 null
e6c3c48 split sql and plpgqsl parsers
Jake Wheat authored
103 continue
c4fe705 added readme, todo, license
Jake Wheat authored
104 perform
e6c3c48 split sql and plpgqsl parsers
Jake Wheat authored
105 execute
106 assignment
107 if
108 return, return next, return query
109 raise
110 for (select and integer variants)
111 while
c869e96 fix some documentation
Jake Wheat authored
112 case statement
c4fe705 added readme, todo, license
Jake Wheat authored
113
114 Many things are missing at the moment, in particular
5f16b6b work on docs
Jake Wheat authored
115 selects: cte, implicit joins
87bf41d readme updates
Jake Wheat authored
116 joins in updates (delete from, update using)
f956e27 added asc,desc to select order by
Jake Wheat authored
117 alter statements
118 create and drop apart from table, view, domain, type, function
c4fe705 added readme, todo, license
Jake Wheat authored
119 transaction commands
120 triggers and trigger functions
ca573ec tidy some docs
Jake Wheat authored
121 loop statement, labels
c4fe705 added readme, todo, license
Jake Wheat authored
122 error trapping
123 cursors
c869e96 fix some documentation
Jake Wheat authored
124 This is a non-exhaustive list.
c4fe705 added readme, todo, license
Jake Wheat authored
125
2a49cf8 add extension_system design, sort out README
Jake Wheat authored
126 Expression support is patchy, should work pretty well for a lot of
4042432 do some hlint fixes
Jake Wheat authored
127 simple stuff though. There is a strong possibility that for some
128 complex selects and expressions, the implicit precedence (that is,
40df5ac merge from trunk
Jake Wheat authored
129 bits without enclosing parenthesis) may parse in the wrong
4042432 do some hlint fixes
Jake Wheat authored
130 direction. Please let me know if you encounter such an error.
2a49cf8 add extension_system design, sort out README
Jake Wheat authored
131
5f16b6b work on docs
Jake Wheat authored
132 == Type checking
8f4715d discovered choice parser, used it
Jake Wheat authored
133
5f16b6b work on docs
Jake Wheat authored
134 Type checking supports a good subset of expressions and select
ca573ec tidy some docs
Jake Wheat authored
135 statements that the parser parses, and has basic support for insert,
136 update, delete and the various create statements that the parser
137 supports. Development work is currently focused in this area.
c4fe705 added readme, todo, license
Jake Wheat authored
138
5f16b6b work on docs
Jake Wheat authored
139 = Other current downsides:
66ecc43 some updates to readme file
Jake Wheat authored
140
333619b work on api, haddock, comments
Jake Wheat authored
141 The design of the AST node types is pretty basic.
66ecc43 some updates to readme file
Jake Wheat authored
142
cf4ce06 tidying up comments, documentation, and a bit of unused code deletion
Jake Wheat authored
143 Not much work has been done on correctly rejecting invalid SQL
144 (although it does pretty well despite this) and not much thought has
145 been put into error messages and error reporting yet, this is slowly
333619b work on api, haddock, comments
Jake Wheat authored
146 improving, and at some point will become a major focus - I hope this
147 code will provide substantial benefits when developing in PL/pgSQL in
148 the future.
66ecc43 some updates to readme file
Jake Wheat authored
149
f23bf1e got new file arrangement compiling
Jake Wheat authored
150 Only supports PostgreSQL SQL and PL/pgSQL.
66ecc43 some updates to readme file
Jake Wheat authored
151
333619b work on api, haddock, comments
Jake Wheat authored
152 Future plans (provisional):
054d415 few small documentation fixes
Jake Wheat authored
153
154 * use this system to develop a Lint-type checker for PL/pgSQL;
155
37a1522 some spelling fixes
Jake Wheat authored
156 * provide support to help developing SQL from an IDE (targeting Emacs
333619b work on api, haddock, comments
Jake Wheat authored
157 mainly)
158
054d415 few small documentation fixes
Jake Wheat authored
159 * support type checking simple SQL statements that you'd embed in
160 Haskell code, including with ? placeholders, to support generating
cf4ce06 tidying up comments, documentation, and a bit of unused code deletion
Jake Wheat authored
161 type safe wrappers - could integrate with MetaHDBC?;
054d415 few small documentation fixes
Jake Wheat authored
162
c2ec782 work on attribute qualification in joins
Jake Wheat authored
163 * possibly a lightweight code generation/ simple macro support to help
164 with developing more robust PL/pgSQL code.
e149d4a @JakeWheat add aliases for typehecking functions to minimise api breakage from
authored
165
166 * documentation generation
Something went wrong with that request. Please try again.