From 2e938857fa3ce50e4e5fbccdcb65272f868e7da9 Mon Sep 17 00:00:00 2001 From: John A Stevenson Date: Sun, 22 May 2022 21:43:01 +0100 Subject: [PATCH] Make table_info available as top-level import --- etlhelper/__init__.py | 3 +++ etlhelper/utils.py | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/etlhelper/__init__.py b/etlhelper/__init__.py index b3a962b..8c45e81 100644 --- a/etlhelper/__init__.py +++ b/etlhelper/__init__.py @@ -26,6 +26,9 @@ get_connection_string, get_sqlalchemy_connection_string, ) +from etlhelper.utils import ( + table_info, +) from . import _version __version__ = _version.get_versions()['version'] diff --git a/etlhelper/utils.py b/etlhelper/utils.py index 2d8cd6c..12aab37 100644 --- a/etlhelper/utils.py +++ b/etlhelper/utils.py @@ -12,11 +12,12 @@ def table_info(table, conn, schema=None): """ - Describe the name and data type for columns in a table. + Return basic metadata for each of the columns of 'table' on 'conn'. :param table: str, the table to describe :param conn: dbapi connection :param schema: str, optional name of schema for table + :returns columns: list, tuples of (name, type, not_null, has_default) """ helper = DB_HELPER_FACTORY.from_conn(conn)