Get the mysql's tokens by the tool.
Project description
mysqltokenparser
A awesome tool that easy to get MySQL’s tokens.
Free software: MIT license
Documentation: https://mysqltokenparser.readthedocs.io.
Quickstart
0x01 安装
pip install mysqltokenparser
0x02 使用教程
import mysqltokenparser as mtp
sql = u"""
ALTER TABLE t_a_gun2_6_dw_pfm_emp_cm ADD INDEX idx_eob_date(empid_org_bus (200),pfm_date);
"""
tokens = mtp.mysql_token_parser(sql)
print tokens
#{
# "type": "ddl",
# "data": {
# "type": "altertable",
# "data": {
# "tablename": "t_a_gun2_6_dw_pfm_emp_cm",
# "alter_data": [{
# "type": "addindex",
# "data": {
# "indexdefinition": {
# "columnnames": ["empid_org_bus", "pfm_date"]
# },
# "indexname": "idx_eob_date"
# }
# }]
# }
# }
#}
Features
Current version only support create and alter table
TODO:SUPPORT MORE SQL STATEMENTS
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
2.0.0 (2019-11-14)
Refactor API.
0.1.0 (2019-07-08)
First release on PyPI.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mysqltokenparser-2.1.0.tar.gz
(402.0 kB
view hashes)
Built Distribution
Close
Hashes for mysqltokenparser-2.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 750610fe2c964bc6c0b34d82fd79c229710e2771388c85dbc4df5c3e0a6bf481 |
|
MD5 | f299c52e9297bdedb58938b2fa7711ea |
|
BLAKE2b-256 | 092071583810206457a6cec3880d21fd1c9d9c04b87abb79ef25930911769810 |