new: sqlserver and other refactoring
This commit is contained in:
parent
1eda49b63a
commit
67b91b43ab
|
@ -1,5 +1,5 @@
|
||||||
__author__ = 'The Phi Technology'
|
__author__ = 'The Phi Technology'
|
||||||
__version__= '2.0.0'
|
__version__= '2.0.2'
|
||||||
__license__="""
|
__license__="""
|
||||||
|
|
||||||
|
|
||||||
|
|
8
setup.py
8
setup.py
|
@ -22,10 +22,10 @@ args = {
|
||||||
|
|
||||||
"packages": find_packages(include=['info','transport', 'transport.*'])}
|
"packages": find_packages(include=['info','transport', 'transport.*'])}
|
||||||
args["keywords"]=['mongodb','couchdb','rabbitmq','file','read','write','s3','sqlite']
|
args["keywords"]=['mongodb','couchdb','rabbitmq','file','read','write','s3','sqlite']
|
||||||
args["install_requires"] = ['pyncclient','pymongo','sqlalchemy','pandas','typer','pandas-gbq','numpy','cloudant','pika','nzpy','boto3','boto','pyarrow','google-cloud-bigquery','google-cloud-bigquery-storage','flask-session','smart_open','botocore','psycopg2-binary','mysql-connector-python','numpy']
|
args["install_requires"] = ['pyncclient','pymongo','sqlalchemy','pandas','typer','pandas-gbq','numpy','cloudant','pika','nzpy','boto3','boto','pyarrow','google-cloud-bigquery','google-cloud-bigquery-storage','flask-session','smart_open','botocore','psycopg2-binary','mysql-connector-python','numpy','pymssql']
|
||||||
args["url"] = "https://healthcareio.the-phi.com/git/code/transport.git"
|
args["url"] = "https://healthcareio.the-phi.com/git/code/transport.git"
|
||||||
args['scripts'] = ['bin/transport']
|
args['scripts'] = ['bin/transport']
|
||||||
if sys.version_info[0] == 2 :
|
# if sys.version_info[0] == 2 :
|
||||||
args['use_2to3'] = True
|
# args['use_2to3'] = True
|
||||||
args['use_2to3_exclude_fixers']=['lib2to3.fixes.fix_import']
|
# args['use_2to3_exclude_fixers']=['lib2to3.fixes.fix_import']
|
||||||
setup(**args)
|
setup(**args)
|
||||||
|
|
|
@ -27,6 +27,8 @@ CALLBACK = 'callback'
|
||||||
CONSOLE = 'console'
|
CONSOLE = 'console'
|
||||||
RABBITMQ = 'rabbitmq'
|
RABBITMQ = 'rabbitmq'
|
||||||
DATABRICKS = 'databricks'
|
DATABRICKS = 'databricks'
|
||||||
|
MSSQL ='sqlserver'
|
||||||
|
SQLSERVER ='sqlserver'
|
||||||
|
|
||||||
#
|
#
|
||||||
# synonyms of the above
|
# synonyms of the above
|
||||||
|
|
|
@ -3,7 +3,7 @@ This namespace/package wrap the sql functionalities for a certain data-stores
|
||||||
- netezza, postgresql, mysql and sqlite
|
- netezza, postgresql, mysql and sqlite
|
||||||
- mariadb, redshift (also included)
|
- mariadb, redshift (also included)
|
||||||
"""
|
"""
|
||||||
from . import postgresql, mysql, netezza, sqlite
|
from . import postgresql, mysql, netezza, sqlite, sqlserver
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
"""
|
||||||
|
Handling Microsoft SQL Server via pymssql driver/connector
|
||||||
|
"""
|
||||||
|
import sqlalchemy
|
||||||
|
import pandas as pd
|
||||||
|
from transport.sql.common import Base, BaseReader, BaseWriter
|
||||||
|
|
||||||
|
|
||||||
|
class MsSQLServer:
|
||||||
|
def __init__(self,**_args) :
|
||||||
|
super().__init__(**_args)
|
||||||
|
pass
|
||||||
|
def get_provider(self):
|
||||||
|
# mssql+pymssql://scott:tiger@hostname:port/dbname"
|
||||||
|
return "mssql+pymssql"
|
||||||
|
def get_default_port(self):
|
||||||
|
return "1433"
|
||||||
|
class Reader (MsSQLServer,BaseReader):
|
||||||
|
def __init__(self,**_args):
|
||||||
|
super().__init__(**_args)
|
||||||
|
|
||||||
|
class Writer (MsSQLServer,BaseWriter):
|
||||||
|
def __init__(self,**_args):
|
||||||
|
super().__init__(**_args)
|
Loading…
Reference in New Issue