Skip to content

Latest commit

 

History

History
30 lines (23 loc) · 2.09 KB

README.md

File metadata and controls

30 lines (23 loc) · 2.09 KB

License GPL 3

mysql-to-org-mode for emacs

Minor mode for emacs to output the results of mysql queries to org tables, with auto completion of table and column names and parameter replacement.

mysql-to-org-mode screencast

Installation

mysql-to-org is available as a MELPA package: M-x package-install [RET] mysql-to-org [RET]

Customization

The mysql command and the mysql user can be changed through the variables mysql-to-org-mysql-command variable (defaults to "mysql") and mysql-to-org-mysql-user (defaults to "root").

Usage

  1. Activate the minor mode by pressing M-x mysql-to-org-mode or adding the mode as a hook to another mode, f.ex. (add-hook 'php-mode-hook 'mysql-to-org-mode).
  2. On first activiation of the mode, you will be asked to enter a password to connect to mysql.
  3. When the mode is active, the following commands are available:
  • C-c C-m e (mysql-to-org-eval): evaluate the mysql query inside the active region or current line.
  • C-c C-m p (mysql-to-org-eval-string-at-point): evaluate the string at point.
  • C-c C-m s (mysql-to-org-scratch): open a scratch buffer to evaluate mysql queries.
  • C-c C-m 1 (mysql-to-org-only-show-output-window): only show the output window with the query results.
  • C-c C-m r (mysql-to-org-reload-completion-candidates): reload the completion candidates (f.ex. after changing the database schema).
  1. If a query contains parameters, you will be asked to supply values for these parameters in the minibuffer to evaluate the query. The regexp to find parameters can be customized with the mysql-to-org-parameter-regexp variable.
  2. All table names and column names are available for auto completion using the completion-at-point-functions.
  3. Query results are available as org tables.