Merge lp:~akiban-technologies/akiban-sql-parser/1.0.16-update into lp:~akiban-technologies/akiban-sql-parser/trunk

Proposed by Nathan Williams
Status: Merged
Approved by: Nathan Williams
Approved revision: 301
Merged at revision: 300
Proposed branch: lp:~akiban-technologies/akiban-sql-parser/1.0.16-update
Merge into: lp:~akiban-technologies/akiban-sql-parser/trunk
Diff against target: 180 lines (+106/-35)
2 files modified
README.rst (+105/-34)
pom.xml (+1/-1)
To merge this branch: bzr merge lp:~akiban-technologies/akiban-sql-parser/1.0.16-update
Reviewer Review Type Date Requested Status
Akiban Technologies Pending
Review via email: mp+163185@code.launchpad.net

Description of the change

Bump version to 1.0.16 after release.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README.rst'
2--- README.rst 2012-11-30 15:38:33 +0000
3+++ README.rst 2013-05-09 16:59:26 +0000
4@@ -1,58 +1,129 @@
5-************************************
6 Akiban SQL Parser
7-************************************
8+=================
9
10 Overview
11-========
12+--------
13
14 The Akiban SQL Parser is a complete, production-quality Java parser for the SQL
15 language. It defines the SQL grammar as implemented by Akiban, but can be used
16 independently. It is derived from the Apache Derby parser.
17
18-Building the Akiban SQL Parser From Source
19-==========================================
20-
21-Use Maven (http://maven.apache.org) to build the Akiban SQL Parser.
22-
23-To build::
24-
25- mvn install
26-
27-The resulting jar files are in the ``target`` directory. To build the Javadoc::
28+
29+Building From Source
30+--------------------
31+
32+`Maven <http://maven.apache.org>`_ is used to build, test, and deploy.
33+
34+Run tests and create jars::
35+
36+ mvn package
37+
38+The resulting jar files are in the ``target`` directory.
39+
40+Generate the documentation::
41
42 mvn javadoc:javadoc
43
44 The resulting Javadoc HTML files are in ``target/site/apidocs``.
45
46-Install Akiban SQL Parser from Binaries
47-=======================================
48+
49+Using From Maven
50+----------------
51+
52+The Akiban SQL Parser is in the standard Maven Central repository. Any Maven
53+project can use it directly by adding the appropriate entries to the
54+``dependencies`` section of its ``pom.xml`` file:
55+
56+.. code-block:: xml
57+
58+ <dependencies>
59+ <dependency>
60+ <groupId>com.akiban</groupId>
61+ <artifactId>akiban-sql-parser</artifactId>
62+ <version>1.0.15</version>
63+ </dependency>
64+ </dependencies>
65+
66+
67+Installing From Binaries
68+------------------------
69
70 Pre-built jars can be downloaded directly from
71-https://launchpad.net/akiban-sql-parser/+download
72-
73-Unpack the distribution kit into a convenient directory using the
74-appropriate utility (e.g. unzip or tar).
75+https://launchpad.net/akiban-sql-parser/+download. Expand the package into a
76+into a convenient directory using the appropriate utility
77+(e.g. ``unzip`` or ``tar``).
78
79 Review the ``LICENSE.txt`` file located in the root of the installation
80-directory. The Akiban SQL Parser is licensed under the Eclipse Public
81-License or a free-use community license, see our
82-`licensing options <http://www.akiban.com/akiban-licensing-options>`_
83-for more details. By installing, copying or otherwise using the Software
84+directory. The Akiban SQL Parser is licensed under the Apache License,
85+Version 2.0. By installing, copying or otherwise using the Software
86 contained in the distribution kit, you agree to be bound by the terms of the
87 license agreement. If you do not agree to these terms, remove and destroy all
88 copies of the software in your possession immediately.
89
90+
91 Working with the Akiban SQL Parser
92-==================================
93-
94-Add the jar file (e.g. ``akiban-sql-parser-1.0.12.jar``), found in the root
95-directory of the distribution kit, to your project's classpath. For example,
96-copy it to ``jre/lib/ext`` in your Java Runtime Environment, or add it to
97-your classpath environment variable..
98+----------------------------------
99+
100+The following example demonstrates the simplest usage:
101+
102+.. code-block:: java
103+
104+ import com.akiban.sql.parser.SQLParser;
105+ import com.akiban.sql.parser.StatementNode;
106+
107+ public class ParserHello {
108+ public static void main(String[] args) throws Exception {
109+ SQLParser parser = new SQLParser();
110+ for(String s : args) {
111+ StatementNode stmt = parser.parseStatement(s);
112+ stmt.treePrint();
113+ }
114+ }
115+ }
116+
117+A new `SQLParser <http://akiban.github.io/sql-parser/javadoc/com/akiban/sql/parser/SQLParser.html>`_
118+is instantiated and each command line argument is
119+`parsed <http://akiban.github.io/sql-parser/javadoc/com/akiban/sql/parser/SQLParser.html#parseStatement%28java.lang.String%29>`_
120+and `printed <http://akiban.github.io/sql-parser/javadoc/com/akiban/sql/parser/QueryTreeNode.html#treePrint%28%29>`_
121+to standard output. The result is a debug dump of all nodes in the underlying Abstract Syntax Tree.
122+More advanced usages will generally parse a statement and then pass a custom
123+`Visitor <http://akiban.github.io/sql-parser/javadoc/com/akiban/sql/parser/Visitor.html>`_ to the
124+`accept() <http://akiban.github.io/sql-parser/javadoc/com/akiban/sql/parser/QueryTreeNode.html#accept%28com.akiban.sql.parser.Visitor%29>`_ method.
125+
126+To compile and run the example from the command line, copy the code into a
127+file named ``ParserHello.java`` and ensure the parser jar file, found in
128+the root directory of the binary package, is in your ``classpath``::
129+
130+ $ export CLASSPATH="akiban-sql-parser-1.0.15.jar:."
131+
132+Compile::
133+
134+ $ javac ParserHello.java
135+
136+Run (output trimmed for simplicity)::
137+
138+ $ java ParserHello "SELECT a FROM b"
139+ com.akiban.sql.parser.CursorNode@5889dee2
140+ statementType: SELECT
141+ resultSet:
142+ com.akiban.sql.parser.SelectNode@4387f4d7
143+ resultColumns:
144+ [0]:
145+ com.akiban.sql.parser.ResultColumn@5123968
146+ name: a
147+ expression:
148+ com.akiban.sql.parser.ColumnReference@6f76dd71
149+ columnName: a
150+ fromList:
151+ [0]:
152+ com.akiban.sql.parser.FromBaseTable@18317b1d
153+ tableName: b
154+
155
156 More Information
157-================
158-
159-For more information, join the Aiban mailing list on google groups
160-(https://groups.google.com/a/akiban.com/d/forum/akiban-user) or hop on the
161-#akiban channel on irc.freenode.net
162+----------------
163+
164+For more information, join the
165+`akiban-user <https://groups.google.com/a/akiban.com/d/forum/akiban-user>`_
166+mailing list on Google Groups or hop on the #akiban channel on irc.freenode.net
167+
168
169=== modified file 'pom.xml'
170--- pom.xml 2013-05-08 22:13:20 +0000
171+++ pom.xml 2013-05-09 16:59:26 +0000
172@@ -13,7 +13,7 @@
173
174 <groupId>com.akiban</groupId>
175 <artifactId>akiban-sql-parser</artifactId>
176- <version>1.0.15-SNAPSHOT</version>
177+ <version>1.0.16-SNAPSHOT</version>
178 <packaging>jar</packaging>
179
180 <name>Akiban SQL Parser</name>

Subscribers

People subscribed via source and target branches

to all changes: