
    HE^jm                     T    d dl Z d dlmZ d dlmZ de j
                  fdZed        Zy)    N)contextmanager)settingsreturnc                      t        j                  t        j                        } t         j                  | _        | j                  d       | j                  d       | S )NzPRAGMA journal_mode=WALzPRAGMA foreign_keys=ON)sqlite3connectr   DB_FILERowrow_factoryexecuteconns    (/home/container/backend/db/connection.pyget_db_connectionr      sA    ??8++,D{{DLL*+LL)*K    c               #      K   t               } 	 |  | j                          	 | j	                          y# t        $ r | j                           w xY w# | j	                          w xY ww)zMContext manager for sqlite3 connection with auto-commit/rollback and cleanup.N)r   commit	Exceptionrollbackcloser   s    r   db_connectionr      sV      D

 	

	   	

s%   A'4 A'AA A$$A')r   
contextlibr   backend.configr   
Connectionr   r    r   r   <module>r      s4     % #7--  
 
r   