Skip to content

Commit

Permalink
FixUp
Browse files Browse the repository at this point in the history
  • Loading branch information
index-git committed Sep 25, 2023
1 parent 8c70e1e commit b80cf38
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/layman/layer/db/table.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
from psycopg2 import sql

from db import util as db_util
Expand All @@ -7,6 +8,7 @@
from . import get_internal_table_name
from .. import LAYER_TYPE, util as layer_util

logger = logging.getLogger(__name__)
PATCH_MODE = patch_mode.DELETE_IF_DEPENDANT


Expand All @@ -26,6 +28,18 @@ def get_layer_info(workspace, layername,):
db_uri_str = None
else:
db_uri_str = table_uri.db_uri_str
try:
db_util.get_connection_pool(db_uri_str=db_uri_str,)
except BaseException:
result['db'] = {
'schema': table_uri.schema,
'table': table_uri.table,
'geo_column': table_uri.geo_column,
'external_uri': layer_util.redact_uri(table_uri.db_uri_str),
'status': 'NOT_AVAILABLE',
'error': 'Cannot connect to DB.',
}
return result
try:
rows = db_util.run_query(f"""
SELECT schemaname, tablename, tableowner
Expand Down

0 comments on commit b80cf38

Please sign in to comment.