
    pi              	       :   S SK JrJr  S SKJr  S SKJr  S SKJr  S SK	r	\	R                  R                  \" \" \5      R                  R                  5      5        S SKJr  \" S\ 3SS	S
.SSSSS9r\R$                  " \S5      S 5       r\" SS\S9r\" 5       rS rg)    )create_engineevent)declarative_base)sessionmaker)PathN)DB_PATHz
sqlite:///F   )check_same_threadtimeoutT   
   )connect_argsechopool_pre_ping	pool_sizemax_overflowconnectc                 T   U R                  5       nUR                  S5        UR                  S5        UR                  S5        UR                  S5        UR                  S5        UR                  S5         UR                  S5        UR                  5         g! [         a     Nf = f)	z:Set SQLite PRAGMA settings for performance and reliabilityzPRAGMA foreign_keys = ONzPRAGMA journal_mode = WALzPRAGMA synchronous = NORMALzPRAGMA busy_timeout = 5000zPRAGMA cache_size = -20000zPRAGMA temp_store = MEMORYzPRAGMA mmap_size = 268435456N)cursorexecute	Exceptionclose)
dbapi_connconnection_recordr   s      6/home/mario/Escritorio/thel4footbal/app/models/base.pyset_sqlite_pragmar      s      F
NN-.
NN./
NN01
NN/0
NN/0
NN/056 LLN  s   8B 
B'&B')
autocommit	autoflushbindc               #   t   #    [        5       n  U v   U R                  5         g! U R                  5         f = f7f)z
Dependency function for FastAPI routes to get database session.

Usage in routes:
    @app.get("/example")
    def example(db: Session = Depends(get_db)):
        # Use db.query() here
        pass
N)SessionLocalr   )dbs    r   get_dbr#   4   s*      
B


s   8# 858)
sqlalchemyr   r   sqlalchemy.ext.declarativer   sqlalchemy.ormr   pathlibr   syspathappendstr__file__parentdatabaser   enginelistens_forr   r!   Baser#        r   <module>r4      s    + 7 '   DN))001 2  
	" 


 69% &  	 r3   