新規作成
This commit is contained in:
14
backend/app/core/database.py
Normal file
14
backend/app/core/database.py
Normal file
@@ -0,0 +1,14 @@
|
||||
import os
|
||||
from psycopg import connect
|
||||
from psycopg.rows import dict_row
|
||||
|
||||
|
||||
def get_connection():
|
||||
return connect(
|
||||
host=os.getenv("DB_HOST"),
|
||||
port=os.getenv("DB_PORT"),
|
||||
dbname=os.getenv("DB_NAME"),
|
||||
user=os.getenv("DB_USER"),
|
||||
password=os.getenv("DB_PASSWORD"),
|
||||
row_factory=dict_row,
|
||||
)
|
||||
Reference in New Issue
Block a user