🎉 Bring SQL console to Slack
Switch branches/tags
Nothing to show
Clone or download
wang502 Merge pull request #1 from Haroenv/patch-1
return the result in a code block
Latest commit f6531e8 Jan 12, 2017
Permalink
Failed to load latest commit information.
PyGreSQL-5.0 README updated May 11, 2016
LICENSE Initial commit May 11, 2016
Procfile initial commit May 11, 2016
README.md README updated May 13, 2016
SlackBot.jpg README updated May 11, 2016
connection.py return the result in a code block Jun 5, 2016
requirements.txt initial commit May 11, 2016
select_update.gif README updated May 11, 2016

README.md

#Slack-SQL screenshot

Install PyGreSQL using pip

The query execution is based on PostgreSQL's python library -- PyGreSQL, it needs to be installed on the server first.

  • On terminal, open bash
  $sudo bash
  • Adding system variables
  $export CFLAGS=-Qunused-arguments
  $export CPPFLAGS=-Qunused-arguments
  • Install
  $pip install PyGreSQL

Install PyGreSQL from source

go into PostgreSQL-5.0 folder, type the folowing commands

python setup.py build
python setup.py install

Set up:

  1. Clone this repo
  2. Config your database name, host, port, user name, and password in connection.py
db = DB(dbname='',host='',port= ,user='',passwd='')
  1. Deploy this to server(For example, Heroku).
  2. Add this integration to your Slack. Specify your url in the Slack integration URL.
  3. All set!

Deploy to Heroku

Deploy

Slack example command:

  • create table:
  /sql create table users(id primary key, name varchar, email varchar, age int)
  • Insert data:
  /sql insert into users values(1, 'Seth Wang')
  • selection:
  /sql select users.name from users where id=1
  • deletion
  /sql delete from users where id=2