-Broytman mysql to sql converter, Copyright (C) 2016 PhiloSoft Design
+Broytman SQL converter, Copyright (C) 2016 PhiloSoft Design
Author: Oleg Broytman <phd@phdru.name>
License: GPL
-This is mysql2sql, a mysql to sql converter. Intended primarily to
-convert mysqldump (especially with extended INSERT syntax) to standard
-SQL to load at least to PostgreSQL or SQLite.
+This is sqlconvert, a a library to perform SQL convertions. It uses
+sqlparse to parse SQL.
-Uses sqlparse to parse SQL.
+The library is in its initial phase and currently cannot do much.
-The program is in its initial phase and currently cannot do much.
+The first goal is to implemet mysq2sql, a script intended primarily to
+convert mysqldump output (especially with extended INSERT syntax) to
+standard SQL to load at least to PostgreSQL or SQLite.
from __future__ import print_function
import sys
-from mysql2sql.print_tokens import print_tokens
-from mysql2sql.process_tokens import requote_names, find_error, \
+from sqlconvert.print_tokens import print_tokens
+from sqlconvert.process_tokens import requote_names, find_error, \
StatementGrouper
from __future__ import print_function
import sys
-from mysql2sql.print_tokens import print_tokens
-from mysql2sql.process_tokens import requote_names, find_error, \
+from sqlconvert.print_tokens import print_tokens
+from sqlconvert.process_tokens import requote_names, find_error, \
StatementGrouper
import sys
from sqlparse import parse
-from mysql2sql.print_tokens import print_tokens
-from mysql2sql.process_tokens import requote_names, find_error
+from sqlconvert.print_tokens import print_tokens
+from sqlconvert.process_tokens import requote_names, find_error
def main(filename):
import sys
from sqlparse import parse
-from mysql2sql.print_tokens import print_tokens
-from mysql2sql.process_tokens import requote_names, find_error
+from sqlconvert.print_tokens import print_tokens
+from sqlconvert.process_tokens import requote_names, find_error
def main(*queries):
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
- @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/mysql2sql.qhcp"
+ @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/sqlconvert.qhcp"
@echo "To view the help file:"
- @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/mysql2sql.qhc"
+ @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/sqlconvert.qhc"
.PHONY: applehelp
applehelp:
@echo
@echo "Build finished."
@echo "To view the help file:"
- @echo "# mkdir -p $$HOME/.local/share/devhelp/mysql2sql"
- @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/mysql2sql"
+ @echo "# mkdir -p $$HOME/.local/share/devhelp/sqlconvert"
+ @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/sqlconvert"
@echo "# devhelp"
.PHONY: epub
# -*- coding: utf-8 -*-
#
-# mysql2sql documentation build configuration file, created by
+# sqlconvert documentation build configuration file, created by
# sphinx-quickstart on Fri Jul 22 19:32:24 2016.
#
# This file is execfile()d with the current directory set to its
master_doc = 'index'
# General information about the project.
-project = u'mysql2sql'
+project = u'sqlconvert'
copyright = u'2016, Oleg Broytman'
author = u'Oleg Broytman'
# The name for this set of Sphinx documents.
# "<project> v<release> documentation" by default.
#
-# html_title = u'mysql2sql v0.0.1'
+# html_title = u'sqlconvert v0.0.1'
# A shorter title for the navigation bar. Default is the same as html_title.
#
# html_search_scorer = 'scorer.js'
# Output file base name for HTML help builder.
-htmlhelp_basename = 'mysql2sqldoc'
+htmlhelp_basename = 'sqlconvert_doc'
# -- Options for LaTeX output ---------------------------------------------
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
- (master_doc, 'mysql2sql.tex', u'mysql2sql Documentation',
+ (master_doc, 'sqlconvert.tex', u'sqlconvert Documentation',
u'Oleg Broytman', 'manual'),
]
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
- (master_doc, 'mysql2sql', u'mysql2sql Documentation',
+ (master_doc, 'sqlconvert', u'sqlconvert Documentation',
[author], 1)
]
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
- (master_doc, 'mysql2sql', u'mysql2sql Documentation',
- author, 'mysql2sql', 'One line description of project.',
+ (master_doc, 'sqlconvert', u'sqlconvert Documentation',
+ author, 'sqlconvert', 'One line description of project.',
'Miscellaneous'),
]
cd "`dirname $0`"/.. &&
exec sphinx-apidoc --separate --module-first --suffix=rst --force \
- --output-dir=docs/api mysql2sql
+ --output-dir=docs/api sqlconvert
-.. mysql2sql documentation master file, created by
+.. sqlconvert documentation master file, created by
sphinx-quickstart on Fri Jul 22 19:32:24 2016.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
-Welcome to mysql2sql's documentation!
+Welcome to sqlconvert's documentation!
=====================================
-This is mysql2sql, a mysql to sql converter. It is primary intended to
-convert mysqldump (especially with extended INSERT syntax) to standard
-SQL to load at least to PostgreSQL or SQLite.
-
-It uses `sqlparse <https://github.com/andialbrecht/sqlparse>`_ to parse
-SQL.
+This is sqlconvert, a library to implenet SQL converters. It uses `sqlparse
+<https://github.com/andialbrecht/sqlparse>`_ to parse SQL.
The program is in its initial phase and currently cannot do much.
-.. highlight:: none
-
-Command line
-------------
-
-mysql2sql
-~~~~~~~~~
-
-Usage::
-
- mysql2sql [-e encoding] [-E output_encoding] [infile] [[-o] outfile]
-
-Options::
-
- -e ENCODING, --encoding ENCODING
- input/output encoding, default is utf-8
- -E OUTPUT_ENCODING, --output-encoding OUTPUT_ENCODING
- separate output encoding, default is the same as
- `-e` except for console; for console output charset
- from the current locale is used
- -P, --no-pbar Inhibit progress bar
- infile Input file, stdin if absent or '-'
- -o, --outfile outfile Output file, stdout if absent or '-'
-
-If stderr is connected to the console the program displays a text mode progress
-bar. Option `-P/--no-pbar` inhibits it.
-
-Option `-o` is useful when infile is absent (input is redirected), for
-example::
+The first goal is to implemet `mysq2sql <mysq2sql.html>`_, a script intended
+primarily to convert mysqldump (especially with extended INSERT syntax) to
+standard SQL to load at least to PostgreSQL or SQLite.
- mysql2sql -o outfile.sql < infile.sql
- cat infile.sql | mysql2sql -o outfile.sql
+Contents:
-But of course it simply can be::
+.. toctree::
+ :maxdepth: 2
- mysql2sql - outfile.sql < infile.sql
- cat infile.sql | mysql2sql - outfile.sql
+ mysq2sql
Indices and tables
--- /dev/null
+.. mysql2sql documentation master file, created by
+ sphinx-quickstart on Fri Jul 22 19:32:24 2016.
+ You can adapt this file completely to your liking, but it should at least
+ contain the root `toctree` directive.
+
+Welcome to mysql2sql's documentation!
+=====================================
+
+This is mysql2sql, a mysql to sql converter. It is primary intended to
+convert mysqldump (especially with extended INSERT syntax) to standard
+SQL to load at least to PostgreSQL or SQLite.
+
+The program is in its initial phase and currently cannot do much.
+
+.. highlight:: none
+
+Command line
+------------
+
+mysql2sql
+~~~~~~~~~
+
+Usage::
+
+ mysql2sql [-e encoding] [-E output_encoding] [infile] [[-o] outfile]
+
+Options::
+
+ -e ENCODING, --encoding ENCODING
+ input/output encoding, default is utf-8
+ -E OUTPUT_ENCODING, --output-encoding OUTPUT_ENCODING
+ separate output encoding, default is the same as
+ `-e` except for console; for console output charset
+ from the current locale is used
+ -P, --no-pbar Inhibit progress bar
+ infile Input file, stdin if absent or '-'
+ -o, --outfile outfile Output file, stdout if absent or '-'
+
+If stderr is connected to the console the program displays a text mode progress
+bar. Option `-P/--no-pbar` inhibits it.
+
+Option `-o` is useful when infile is absent (input is redirected), for
+example::
+
+ mysql2sql -o outfile.sql < infile.sql
+ cat infile.sql | mysql2sql -o outfile.sql
+
+But of course it simply can be::
+
+ mysql2sql - outfile.sql < infile.sql
+ cat infile.sql | mysql2sql - outfile.sql
umask 022 &&
-git archive --format=tar --prefix=mysql2sql/ "${1:-HEAD}" |
+git archive --format=tar --prefix=sqlconvert/ "${1:-HEAD}" |
(cd "$HOME/tmp" && exec tar xf -) &&
-cp -ap docs "$HOME/tmp/mysql2sql" &&
+cp -ap docs "$HOME/tmp/sqlconvert" &&
-cd "$HOME/tmp/mysql2sql" &&
+cd "$HOME/tmp/sqlconvert" &&
chmod -R u=rwX,go=rX docs &&
python setup.py sdist --formats=bztar &&
-cd dist && mv mysql2sql-*.tar.bz2 ../.. && cd ../.. && exec rm -rf mysql2sql
+cd dist && mv sqlconvert-*.tar.bz2 ../.. && cd ../.. && exec rm -rf sqlconvert
#! /bin/sh
-web="$HOME"/Internet/WWW/htdocs/phdru.name/Software/Python/mysql2sql/docs
+web="$HOME"/Internet/WWW/htdocs/phdru.name/Software/Python/sqlconvert/docs
cd "`dirname \"$0\"`"/docs/_build/html &&
rsync -ahP --del * --exclude=objects.inv "$web" &&
import sys
from sqlparse.compat import text_type
-from mysql2sql.print_tokens import print_tokens
-from mysql2sql.process_tokens import requote_names, StatementGrouper
+from sqlconvert.print_tokens import print_tokens
+from sqlconvert.process_tokens import requote_names, StatementGrouper
from m_lib.defenc import default_encoding
from m_lib.pbar.tty_pbar import ttyProgressBar
from distutils.core import setup
is_setuptools = False
-versionpath = join(abspath(dirname(__file__)), 'mysql2sql', '__version__.py')
-load_source('mysql2sql_version', versionpath)
+versionpath = join(abspath(dirname(__file__)), 'sqlconvert', '__version__.py')
+load_source('sqlconvert_version', versionpath)
# Ignore: E402 module level import not at top of file
-from mysql2sql_version import __version__ # noqa
+from sqlconvert_version import __version__ # noqa
-setup(name='mysql2sql',
+setup(name='sqlconvert',
version=__version__,
- description='Broytman mysql2sql',
+ description='Broytman sqlconvert',
long_description=open('README.txt', 'rtU').read(),
author='Oleg Broytman',
author_email='phd@phdru.name',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
],
- packages=['mysql2sql'],
+ packages=['sqlconvert'],
package_data={},
- scripts=['scripts/mysql2sql'],
+ scripts=['scripts/sqlconvert'],
requires=['sqlparse', 'm_lib'],
)
import unittest
-from mysql2sql.print_tokens import tlist2str
-from mysql2sql.process_tokens import requote_names, StatementGrouper
+from sqlconvert.print_tokens import tlist2str
+from sqlconvert.process_tokens import requote_names, StatementGrouper
from tests import main
import unittest
from sqlparse import parse
-from mysql2sql.process_tokens import requote_names
-from mysql2sql.print_tokens import tlist2str
+from sqlconvert.process_tokens import requote_names
+from sqlconvert.print_tokens import tlist2str
from tests import main