Skip to content

Commit

Permalink
Lazy load of tables info in GPKP connector (this avoid too early init…
Browse files Browse the repository at this point in the history
…ialization and makes sure translations are properly joined to tables info)
  • Loading branch information
gacarrillor committed Oct 25, 2024
1 parent 4c6d789 commit 82fe2c8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modelbaker/dbconnector/gpkg_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def __init__(self, uri, schema):
self.conn.row_factory = sqlite3.Row
self.uri = uri
self._bMetadataTable = self._metadata_exists()
self._tables_info = self._get_tables_info()
self._tables_info = []
self.iliCodeName = "iliCode"
self.tid = "T_Id"
self.tilitid = "T_Ili_Tid"
Expand Down Expand Up @@ -98,6 +98,8 @@ def _table_exists(self, tablename):
return result

def get_tables_info(self):
if not self._tables_info:
self._tables_info = self._get_tables_info()
return self._tables_info

def _get_tables_info(self):
Expand Down

0 comments on commit 82fe2c8

Please sign in to comment.