File tree Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -18,19 +18,11 @@ def create_connection(
18
18
user : Optional [str ] = None ,
19
19
password : Optional [str ] = None
20
20
) -> Optional [Union [sqlite3 .Connection , psycopg2 .extensions .connection ]]:
21
- """
22
- Create or connect to a database.
21
+ global _schema_cache
23
22
24
- Parameters:
25
- - db_name (str): Name of the database.
26
- - db_type (str): Type of the database ('sqlite' or 'postgresql').
27
- - host (Optional[str]): Host address (for PostgreSQL).
28
- - user (Optional[str]): Username (for PostgreSQL).
29
- - password (Optional[str]): Password (for PostgreSQL).
23
+ # Reset schema cache when using a new database
24
+ _schema_cache = {}
30
25
31
- Returns:
32
- - Optional[Connection]: Database connection object or None if connection fails.
33
- """
34
26
try :
35
27
if db_type .lower () == 'postgresql' :
36
28
conn = psycopg2 .connect (
You can’t perform that action at this time.
0 commit comments