Emacs minor mode for supporting the use of variables inside sql queries.
This project is inspired from restclient-mode
exsqlaim-mode
is a minor mode for sql-mode
. It can be enabled when sql-mode
is enabled:
(add-hook 'sql-mode-hook
(lambda()
(exsqlaim-mode--fontify 'sql-mode)
(exsqlaim-mode)
))
Variables can be defined as follows:
@db = `test`
@id = 1234
@name = "John Doe"
The defined variables can be used inside queries:
SELECT * FROM @db.users WHERE id = @id OR name = @name;
C-c C-c
: Execute / Send the query to the sql processC-c C-i
: Update the query so that the variables are replaced by the values