mirror of https://github.com/sgoudham/Enso-Bot.git
Deleted db.py
parent
11e49fa6bb
commit
1a1fc71a8e
@ -1,26 +0,0 @@
|
|||||||
import asyncio
|
|
||||||
|
|
||||||
import aiomysql
|
|
||||||
from decouple import config
|
|
||||||
|
|
||||||
# Get password/host from .env
|
|
||||||
password = config('DB_PASS')
|
|
||||||
host = config('DB_HOST')
|
|
||||||
|
|
||||||
|
|
||||||
# Setting up connection using pool/aiomysql
|
|
||||||
async def connection(loop):
|
|
||||||
pool = await aiomysql.create_pool(
|
|
||||||
host=host,
|
|
||||||
port=3306,
|
|
||||||
user="hamothy",
|
|
||||||
password=password,
|
|
||||||
db='enso',
|
|
||||||
loop=loop)
|
|
||||||
|
|
||||||
return pool
|
|
||||||
|
|
||||||
|
|
||||||
# Make sure the connection is setup before the bot is ready
|
|
||||||
loop = asyncio.get_event_loop()
|
|
||||||
loop.run_until_complete(connection(loop))
|
|
Loading…
Reference in New Issue