ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

My​Sublime​QL

by biannetta ST2

A Sublime Text 2 plugin to autocomplete for SQL scripts using a mysql connection to provide database table/column names

Details

  • 2013.12.12.17.35.06
  • github.​com
  • github.​com
  • 11 years ago
  • 2 hours ago
  • 11 years ago

Installs

  • Total 3K
  • Win 2K
  • Mac 671
  • Linux 513
Dec 22 Dec 21 Dec 20 Dec 19 Dec 18 Dec 17 Dec 16 Dec 15 Dec 14 Dec 13 Dec 12 Dec 11 Dec 10 Dec 9 Dec 8 Dec 7 Dec 6 Dec 5 Dec 4 Dec 3 Dec 2 Dec 1 Nov 30 Nov 29 Nov 28 Nov 27 Nov 26 Nov 25 Nov 24 Nov 23 Nov 22 Nov 21 Nov 20 Nov 19 Nov 18 Nov 17 Nov 16 Nov 15 Nov 14 Nov 13 Nov 12 Nov 11 Nov 10 Nov 9 Nov 8
Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

MySublimeQL

A Sublime Text 2 plugin to provide autocompletions in SQL scripts using table/column names from a connected database. MySublimeQL leverages the MySQLdb Python Module to query for completions

Installing

With Package Control If you have Package Control installed you can install via the Install Package option.

With Git: Clone this repository into the ST2 Package folder

Without Git: Download the latest source and move the directory into the ST2 Package folder

Using

Create a new document and set its sytanx to SQL then start typing. A list of table names from the connected schema will start to appear in the autocompletions list. Following SQL conventions, if you type TALBE_NAME followed by a dot (.) autocomplete will display a listing of the columns in the TABLE_NAME.

Switching Schemas

You can cycle through a listing of database connections as defined in your users settings by using the following command:

  • Switch Schema: ctrl+shift+q

A list of avaliable connections will appear in the quick view menu from which you can select the desired connection. Once selected, the autocompletions will rebuild themselves based on the new database tabels/columns

Configuration

MySqublimeQL requires a set of connection parameters that can be defined as follows:

{
    "connections":
    [
        {
            "name": "Schema Name",
            "host": "localhost",
            "user": "username",
            "pass": "password",
            "db"  : "database"
        }
    ],
    "default_schema": "Schema Name"
}

The default schema is set to the name of the schema configuration object that MySublimeQL will default its completion lists