Skip to content

Commit

Permalink
feat: add database echo support (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
allisson authored Oct 6, 2022
1 parent 0ba8f5f commit 15b383f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ fastqueue_server_reload='true'
fastqueue_server_num_workers='1'

fastqueue_database_url='postgresql+psycopg2://fastqueue:fastqueue@localhost:5432/fastqueue-test'
fastqueue_database_echo='true'

fastqueue_min_ack_deadline_seconds='1'
fastqueue_max_ack_deadline_seconds='600'
Expand Down
1 change: 1 addition & 0 deletions fastqueue/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class Settings(BaseSettings):

# postgresql settings
database_url: str
database_echo: bool = False

# queue settings
min_ack_deadline_seconds: int = 1
Expand Down
2 changes: 1 addition & 1 deletion fastqueue/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from fastqueue.logger import get_logger

logger = get_logger(__name__)
engine = create_engine(settings.database_url)
engine = create_engine(settings.database_url, echo=settings.database_echo)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
Base = declarative_base()

Expand Down

0 comments on commit 15b383f

Please sign in to comment.