Initial commit. Basic models mostly done.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
pip
|
||||
@@ -0,0 +1,25 @@
|
||||
Copyright (c) 2016, Andi Albrecht <albrecht.andi@gmail.com>
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* Neither the name of the authors nor the names of its contributors may be
|
||||
used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
@@ -0,0 +1,77 @@
|
||||
Metadata-Version: 2.1
|
||||
Name: sqlparse
|
||||
Version: 0.3.1
|
||||
Summary: Non-validating SQL parser
|
||||
Home-page: https://github.com/andialbrecht/sqlparse
|
||||
Author: Andi Albrecht
|
||||
Author-email: albrecht.andi@gmail.com
|
||||
License: BSD
|
||||
Platform: UNKNOWN
|
||||
Classifier: Development Status :: 5 - Production/Stable
|
||||
Classifier: Intended Audience :: Developers
|
||||
Classifier: License :: OSI Approved :: BSD License
|
||||
Classifier: Operating System :: OS Independent
|
||||
Classifier: Programming Language :: Python
|
||||
Classifier: Programming Language :: Python :: 2
|
||||
Classifier: Programming Language :: Python :: 2.7
|
||||
Classifier: Programming Language :: Python :: 3
|
||||
Classifier: Programming Language :: Python :: 3.4
|
||||
Classifier: Programming Language :: Python :: 3.5
|
||||
Classifier: Programming Language :: Python :: 3.6
|
||||
Classifier: Programming Language :: Python :: 3.7
|
||||
Classifier: Programming Language :: Python :: 3.8
|
||||
Classifier: Topic :: Database
|
||||
Classifier: Topic :: Software Development
|
||||
Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
|
||||
|
||||
|
||||
``sqlparse`` is a non-validating SQL parser module.
|
||||
It provides support for parsing, splitting and formatting SQL statements.
|
||||
|
||||
Visit the `project page <https://github.com/andialbrecht/sqlparse>`_ for
|
||||
additional information and documentation.
|
||||
|
||||
**Example Usage**
|
||||
|
||||
|
||||
Splitting SQL statements::
|
||||
|
||||
>>> import sqlparse
|
||||
>>> sqlparse.split('select * from foo; select * from bar;')
|
||||
[u'select * from foo; ', u'select * from bar;']
|
||||
|
||||
|
||||
Formatting statements::
|
||||
|
||||
>>> sql = 'select * from foo where id in (select id from bar);'
|
||||
>>> print(sqlparse.format(sql, reindent=True, keyword_case='upper'))
|
||||
SELECT *
|
||||
FROM foo
|
||||
WHERE id IN
|
||||
(SELECT id
|
||||
FROM bar);
|
||||
|
||||
|
||||
Parsing::
|
||||
|
||||
>>> sql = 'select * from someschema.mytable where id = 1'
|
||||
>>> res = sqlparse.parse(sql)
|
||||
>>> res
|
||||
(<Statement 'select...' at 0x9ad08ec>,)
|
||||
>>> stmt = res[0]
|
||||
>>> str(stmt) # converting it back to unicode
|
||||
'select * from someschema.mytable where id = 1'
|
||||
>>> # This is how the internal representation looks like:
|
||||
>>> stmt.tokens
|
||||
(<DML 'select' at 0x9b63c34>,
|
||||
<Whitespace ' ' at 0x9b63e8c>,
|
||||
<Operator '*' at 0x9b63e64>,
|
||||
<Whitespace ' ' at 0x9b63c5c>,
|
||||
<Keyword 'from' at 0x9b63c84>,
|
||||
<Whitespace ' ' at 0x9b63cd4>,
|
||||
<Identifier 'somes...' at 0x9b5c62c>,
|
||||
<Whitespace ' ' at 0x9b63f04>,
|
||||
<Where 'where ...' at 0x9b5caac>)
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
../../../bin/sqlformat,sha256=cGAAu5OVEllMMKQWgHoB5F1nxTx-03SJozwXURw5PAo,238
|
||||
sqlparse-0.3.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
||||
sqlparse-0.3.1.dist-info/LICENSE,sha256=wZOCNbgNOekxOOrontw69n4Y7LxA0mZSn6V7Lc5CYxA,1537
|
||||
sqlparse-0.3.1.dist-info/METADATA,sha256=O7UNmVIYx3hY0A5ZCKZFAuihaM_I_cvg5Bgnr9Qb0Os,2353
|
||||
sqlparse-0.3.1.dist-info/RECORD,,
|
||||
sqlparse-0.3.1.dist-info/WHEEL,sha256=kGT74LWyRUZrL4VgLh6_g12IeVl_9u9ZVhadrgXZUEY,110
|
||||
sqlparse-0.3.1.dist-info/entry_points.txt,sha256=S2WxhPln7zXybKRE73ekBicXHh7_BX-KYGFZZaGGqp8,54
|
||||
sqlparse-0.3.1.dist-info/top_level.txt,sha256=eRYisOR7d8EtLKXuWUUAAMOhODItOqrkpxkAGD8CISo,9
|
||||
sqlparse/__init__.py,sha256=eTSiAZ1hsjJOGydcEDD5lTUMxmXhpxSAsAoVAqk-n6w,2249
|
||||
sqlparse/__main__.py,sha256=eDiqhBVKwkOVBz5qUf4vfdeqddDMmBJCre-90_N5124,634
|
||||
sqlparse/__pycache__/__init__.cpython-38.pyc,,
|
||||
sqlparse/__pycache__/__main__.cpython-38.pyc,,
|
||||
sqlparse/__pycache__/cli.cpython-38.pyc,,
|
||||
sqlparse/__pycache__/compat.cpython-38.pyc,,
|
||||
sqlparse/__pycache__/exceptions.cpython-38.pyc,,
|
||||
sqlparse/__pycache__/formatter.cpython-38.pyc,,
|
||||
sqlparse/__pycache__/keywords.cpython-38.pyc,,
|
||||
sqlparse/__pycache__/lexer.cpython-38.pyc,,
|
||||
sqlparse/__pycache__/sql.cpython-38.pyc,,
|
||||
sqlparse/__pycache__/tokens.cpython-38.pyc,,
|
||||
sqlparse/__pycache__/utils.cpython-38.pyc,,
|
||||
sqlparse/cli.py,sha256=bRfhC7XBS0WKjl5LTxaO3u8dr-MS0P5Dof54Lbj975E,5916
|
||||
sqlparse/compat.py,sha256=YoPZNIKfJn6Q6bWSYCMSDrrI7ea8rue902TzIoUJWbU,1087
|
||||
sqlparse/engine/__init__.py,sha256=lOzATurKeptbgCfUeI74VUSw83EzNmm7nGsumT3dQJs,471
|
||||
sqlparse/engine/__pycache__/__init__.cpython-38.pyc,,
|
||||
sqlparse/engine/__pycache__/filter_stack.cpython-38.pyc,,
|
||||
sqlparse/engine/__pycache__/grouping.cpython-38.pyc,,
|
||||
sqlparse/engine/__pycache__/statement_splitter.cpython-38.pyc,,
|
||||
sqlparse/engine/filter_stack.py,sha256=hMTlE3imuzebxdJU4RtOUb66NvEnAhJuEyzN1IlTThk,1225
|
||||
sqlparse/engine/grouping.py,sha256=UUav9ywUpzxysevkCMs9LKL2I6k9WzUWojYLdqj5eRo,13425
|
||||
sqlparse/engine/statement_splitter.py,sha256=q8W7JpV_aOFRUn3SF-V9ppOuDCX72FTS9Qwp_jfd5OU,3732
|
||||
sqlparse/exceptions.py,sha256=IJi6zURp-nLC3rqaX_v1GadMO4IrsX-_9Yf8TOLAfCA,366
|
||||
sqlparse/filters/__init__.py,sha256=VLd1lTnaK--NwVwOYzDA6ZzV_dzsTCJKpictHg_QUiY,1266
|
||||
sqlparse/filters/__pycache__/__init__.cpython-38.pyc,,
|
||||
sqlparse/filters/__pycache__/aligned_indent.cpython-38.pyc,,
|
||||
sqlparse/filters/__pycache__/others.cpython-38.pyc,,
|
||||
sqlparse/filters/__pycache__/output.cpython-38.pyc,,
|
||||
sqlparse/filters/__pycache__/reindent.cpython-38.pyc,,
|
||||
sqlparse/filters/__pycache__/right_margin.cpython-38.pyc,,
|
||||
sqlparse/filters/__pycache__/tokens.cpython-38.pyc,,
|
||||
sqlparse/filters/aligned_indent.py,sha256=Yyq7ej53REQCQV3h2sEjAbVwDGbEBSRJyctNWq_eyJE,5219
|
||||
sqlparse/filters/others.py,sha256=9LjsHEeis6Wz1xuf9WhLDiB3rVD-szuA4uNK1VR4xZc,4758
|
||||
sqlparse/filters/output.py,sha256=6SaBuM8DfmIcQaw8svHJVbv-LOV-NRWOjX9l6qgF3W0,4078
|
||||
sqlparse/filters/reindent.py,sha256=6bm-m2UJkZegauD8W4EmA16vn1gVAgYRzAuypTnRIGo,9553
|
||||
sqlparse/filters/right_margin.py,sha256=jwewGhC0ulqfhWuSKOtORRHDBVoU-QGUV5Kf2ib70j8,1620
|
||||
sqlparse/filters/tokens.py,sha256=xOjcgfpt5ZAzAXzBjZr1zdS54tgjf9_qn68Fpq9yR0Q,1637
|
||||
sqlparse/formatter.py,sha256=4RwcsekrvWvbXtxe5-CuhaDG3v-Iep9ACxgxMd2O9lM,7603
|
||||
sqlparse/keywords.py,sha256=FABPDUIph_ESSBg2OpSUQaQjCAYjQGE9uBNlz2Fu8hw,29378
|
||||
sqlparse/lexer.py,sha256=Q14TlBEYnT_wj64D0LP2v8pJHTZzk2aq6r0OLbkz-rY,2515
|
||||
sqlparse/sql.py,sha256=JReOoPulHm5YAyIM0Gz1Yr9ZqZOmDxA4fFIG-6McLEc,20746
|
||||
sqlparse/tokens.py,sha256=T1zkfyEqEypqHtm5pCgt4FewDj3AoINMl3mi_VHixJQ,1685
|
||||
sqlparse/utils.py,sha256=_FIVia1H4BUTLZAd6dJ-xfTesXwx-GlNtWGSjqZLcHo,3509
|
||||
@@ -0,0 +1,6 @@
|
||||
Wheel-Version: 1.0
|
||||
Generator: bdist_wheel (0.34.2)
|
||||
Root-Is-Purelib: true
|
||||
Tag: py2-none-any
|
||||
Tag: py3-none-any
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
[console_scripts]
|
||||
sqlformat = sqlparse.__main__:main
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
sqlparse
|
||||
Reference in New Issue
Block a user