Skip to content

regadas/sql-trino

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

sql-trino.el

What is it?

Emacs comes with a SQL interpreter which is able to open a connection to databases and present you with a prompt you are probably familiar with (e.g. mysql>, pgsql>, trino>, etc.). This mode gives you the ability to do that for Trino.

How do I get it?

The canonical repository for the source code is https://github.com/regadas/sql-trino.

The recommended way to install the package is to utilize Emacs’s package.el along with MELPA. To set this up, please follow MELPA’s getting started guide, and then run M-x package-install sql-trino.

Doom Emacs

(package! sql-trino)

Requirements

Download the Trino CLI, rename it to trino and put it in your $PATH.

How do I use it?

Within Emacs, run M-x sql-trino. You will be prompted by a minibuffer for a server. Enter a server and you should be greeted by a SQLi buffer with a trino> prompt.

From there you can either type queries in this buffer, or open a sql-mode buffer and send chunks of SQL over to the SQLi buffer with the requisite key-chords.

Org-mode usage

org-mode support is available through the usage of ob-sql-mode, a sql-mode backend for Org Babel.

Install

Check ob-sql-mode installation section.

Doom Emacs
(package! ob-sql-mode)

Example

#+begin_src sql-mode :product trino
prepare customers
from
select c_customer_id
from sf100000.customer
limit ?;
#+end_src
#+begin_src sql-mode :product trino
execute customers using 1;
#+end_src

Contributing

Please open GitHub issues and pull requests.

About

Adds Trino support to SQLi mode.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •