Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wang502/slack-sql
:tada: Bring SQL console to Slack
https://github.com/wang502/slack-sql
heroku pygresql slack slack-bot sql tool
Last synced: 24 days ago
JSON representation
:tada: Bring SQL console to Slack
- Host: GitHub
- URL: https://github.com/wang502/slack-sql
- Owner: wang502
- License: mit
- Created: 2016-05-11T20:26:38.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-01-12T02:54:21.000Z (almost 8 years ago)
- Last Synced: 2024-08-04T04:04:05.592Z (4 months ago)
- Topics: heroku, pygresql, slack, slack-bot, sql, tool
- Language: Python
- Homepage:
- Size: 1.38 MB
- Stars: 117
- Watchers: 6
- Forks: 14
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- starred-awesome - slack-sql - :tada: Bring SQL console to Slack (Python)
README
#Slack-SQL
![screenshot](http://g.recordit.co/bpXw88G5hz.gif)## Install PyGreSQL using pip
The query execution is based on PostgreSQL's python library -- [PyGreSQL](http://www.pygresql.org/), 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```
```python
db = DB(dbname='',host='',port= ,user='',passwd='')
```
3. Deploy this to server(For example, Heroku).
4. Add this integration to your Slack. Specify your url in the Slack integration URL.
5. All set!## Deploy to Heroku
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/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
```