From cdeebd3ce4e8cd8c0f0902c946d8361eab2d3371 Mon Sep 17 00:00:00 2001
From: Steve Nyemba <nyemba@gmail.com>
Date: Mon, 24 Feb 2025 10:22:41 -0600
Subject: [PATCH] bug fix & version update, using schemas read/write

---
 bin/transport           | 14 +++++++++++---
 info/__init__.py        |  2 +-
 transport/sql/common.py | 11 +++++++++--
 3 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/bin/transport b/bin/transport
index eb8b17a..6ca01bc 100755
--- a/bin/transport
+++ b/bin/transport
@@ -103,14 +103,22 @@ def supported (format:Annotated[str,typer.Argument(help="format of the output, s
     else:
          print (_df)
     print ()
-
+@app_i.command(name="version")
+def version ():
+    """
+    This function will return the version of the data-transport
+    """
+    print()
+    print (f'[bold] {transport.__app_name__} ,[blue] {transport.__edition__} edition [/blue], version {transport.__version__}[/bold]')
+    print ()
+ 
 @app_i.command(name="license")
 def info():
     """
     This function will display version and license information
     """
-
-    print (f'[bold] {transport.__app_name__} ,version {transport.__version__}[/bold]')
+    print()
+    print (f'[bold] {transport.__app_name__} ,{transport.__edition__}, version {transport.__version__}[/bold]')
     print ()
     print (transport.__license__)
 
diff --git a/info/__init__.py b/info/__init__.py
index 58e6380..0484b49 100644
--- a/info/__init__.py
+++ b/info/__init__.py
@@ -1,7 +1,7 @@
 __app_name__  = 'data-transport'
 __author__ = 'The Phi Technology'
 __version__= '2.4.18'
-__edition__= 'ent'
+__edition__= 'enterprise'
 __email__  = "info@the-phi.com"
 __license__=f"""
 Copyright 2010 - 2024, Steve L. Nyemba
diff --git a/transport/sql/common.py b/transport/sql/common.py
index f647acb..da87cba 100644
--- a/transport/sql/common.py
+++ b/transport/sql/common.py
@@ -83,6 +83,7 @@ class Base:
 class SQLBase(Base):
     def __init__(self,**_args):
         super().__init__(**_args)
+        self._schema = _args.get('schema',None)
     def get_provider(self):
         raise Exception ("Provider Needs to be set ...")
     def get_default_port(self) :
@@ -122,6 +123,8 @@ class BaseReader(SQLBase):
             sql = _args['sql']
         else:
             _table = _args['table'] if 'table' in _args else self._table
+            if self._schema and type(self._schema) == str :
+                _table = f'{self._schema}.{_table}'
             sql = f'SELECT * FROM {_table}'
         return self.apply(sql)
     
@@ -151,5 +154,9 @@ class BaseWriter (SQLBase):
         #     _mode['schema'] = _args['schema']
         # if 'if_exists' in _args :
         #     _mode['if_exists'] = _args['if_exists']
-
-        _df.to_sql(_table,self._engine,**_mode)
\ No newline at end of file
+        if 'schema' in _args and type(_args['schema']) == str:
+            self._schema = _args.get('schema',None)
+        if self._schema :
+           _mode['schema'] = self._schema
+        _df.to_sql(_table,self._engine,**_mode)    
+        _df.to_sql(_table,self._engine,**_mode)