Skip to content

Commit

Permalink
Make table_info available as top-level import
Browse files Browse the repository at this point in the history
  • Loading branch information
volcan01010 committed May 22, 2022
1 parent 263ce43 commit 2e93885
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions etlhelper/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
3 changes: 2 additions & 1 deletion etlhelper/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 2e93885

Please sign in to comment.