Discover Packages
github.com/flourishsoftware/qdb-mysql
command
module
Version:
v0.0.0-...-759a9f7
Opens a new window with list of versions in this module.
Published: Mar 18, 2024
License: GPL-3.0
Opens a new window with license information.
Imports: 6
Opens a new window with list of imports.
Imported by: ? modules, 0 packages
The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
Opens a new window with list of known importers.
README
README
¶
qdb-mysql
Command line database query utility for MySQL.
Dependencies
Golang
mysqlsh command line utility.
Docs
Docs may be generated with the docs command.
Outputs to the docs directory.
Environment variables:
MYSQL_SERVER
MYSQL_USER
MYSQL_PASS
MYSQL_PORT
Commands (Generate docs for more info):
query
Queries MYSQL_SERVER using the query file (and line number) specified in the arguments.
If the option to generate an output file is enabled, the output file will be by the same filename as the input file.
session
Opens a database session with MYSQL_SERVER.
All queries ran during the session are piped to a session file which is generated in the .qdb-mysql under your user's home directory.
Session filenames are generated with a unique timestammp.
While the session is open, you may run a query or queries from any file and/or line number.
VSCode
This utility uses VSCode for some "glossy" functions.
If you choose not to use VSCode, it is possible your editor can use the following features.
Features using VSCode:
Piping commands into the terminal based on keyboard shortcuts and selected line number.
See .vscode/keybindings.json.
These settings will need to be installed in you user settings.
Example installation location (MacOS): /Users/<username>/Library/Application Support/Code/User/keybindings.json.
Opening SQL results into a new editor tab.
See func openFile(file string) error in session.go.
This is done automatically after each query.
If a tab is already opened
Sub-Commands for session Command:
q ${file}:${lineNumber}
Execute a query from a specific file ${file}, starting at line number ${lineNumber}.
q+ ${file}:${lineNumber}
Same as above, but reopen the session file upon execution.
q ${file}
Execute all queries query from a specific file ${file}.
q+ ${file}
Same as above, but reopen the session file upon execution.
Noted Quirks
Leading comments are ran as empty queries instead of being extracted prior to execution.
When querying by line number, trailing comments can cause execution to continue.
To stop this, just use ; without any comments when delineating queries.
Contributions
You might find that this code needs some tweaks to run with your specific system or to meet your specific needs.
PRs are welcome, and encouraged!
Expand ▾
Collapse ▴
Documentation
¶
There is no documentation for this package.
Source Files
¶
Directories
¶
Click to show internal directories.
Click to hide internal directories.