Package: mitzasql
AboutMitzaSQL is a free Python3 TUI MySQL client for Linux which aims to provide an easy-to-use console alternative to GUI clients. It is not meant to be a full-fledged GUI client, it only provides a read-only view of the database, though you can manipulate the data by using raw SQL queries. Some of the main features are:Manage multiple sessionsView databasesView list of tables, sql views & stored procedures in a databaseView rows in a table or sql view:Easily sort table dataFilter table data using VIM-like commands (:like,:gt,:lt,:in...)SQL Query editor with syntax highlighting,smart autocompleteand clipboard support (optional dependency needs to be installed)VIM style keyboard shortcutsVIM style commands with autocomplete supportMacros supportMitzaSQL is heavily inspired byHeidiSQLand is licensed underMIT. The lexer's tokens implementation used by the auto complete system was taken from thepython-sqlparseproject.DemoWebsitehttps://vladbalmos.github.io/mitzasqlSystem requirementsLinuxPython3 (3.6 - 3.9)MySQL (5.6 - 8)SecurityBy default MitzaSQL stores connection credentials in plain text files in your home directory. If security is a concern you could store the file in an encrypted partition/directory and specify the path to the session file when the program starts using the--sessions_file /path/to/sessions.iniflag. Another option would be not to persist the connection credentials when creating a new session.Performance & known issuesLoading large datasets will slow down the rendering. By default, when opening a table screen only the first 100 records are loaded. The rest of the data is loaded automatically when scrolling down. When running queries with the SQL Query editor make sure you don't load a large number of records or else your user experience might suffer.Dependenciesurwidmysql-connector-pythonappdirspygmentsInstallationpip3 install mitzasqlIf you require clipboard support you need to install the extra dependency:pip3 install mitzasql[clipboard]This will install thepyperclipmodule. Keep in mind thatpypercliprequiresxclip/xselto be installed on Linux, or thegtk/qtpython modules.DevelopmentDependenciestoxDocker (optional)docker-compose (optional)Docker is only required for running the integration tests, testing during feature development can be done with tox alone (see below).Running the development version# If your currently installed Python version != 3.6 use TOXENV to specify it
tox -e dev
source .tox/dev/bin/activate
mitzasqlTo run the program using a different Python version using Docker:./run-in-docker.sh [python version] [mysql version]
# ./run-in-docker.sh 36 mysql55
tox -e dev
source .tox/dev/bin/activate
mitzasqlTestsThe testing process uses tox & Docker to automate running the tests against multiple versions of Python and MySQL servers.During feature development Docker is not really necessary, I use it to run the test MySQL server but it that can be installed directly on the host. If that is the case, then new connection details have to be specified using environmental variables (seetests/db/connection_fixture.pyfor more details).To run the tests during feature development run:cp env.template .env # necessary if using Docker
docker-compose up # necessary if using Docker
toxTo generate code coverage:./coverage.shCode coverage is generated in thehtmlcovdirectory.Integration testingSeetest-mitzasql.shfor more info.UI testingSeetest-mitzasql-ui.shfor more info.