Package: teradatasqlalchemy
Teradata SQL Driver Dialect for SQLAlchemyThis package enablesSQLAlchemyto connect to the Teradata Database.This package requires 64-bit Python 3.4 or later, and runs on Windows, macOS, and Linux. 32-bit Python is not supported.For community support, please visit theTeradata Community forums.For Teradata customer support, please visitTeradata Access.Copyright 2023 Teradata. All Rights Reserved.Table of ContentsRelease NotesInstallationLicenseDocumentationUsing the Teradata SQL Driver Dialect for SQLAlchemyConnection ParametersRelease Notes:teradatasqlalchemy 17.20.0.0Added support for SQLAlchemy >= 2.0divoperator is no more supported.teradatasqlalchemy 17.0.0.5Added xviews support for below APIs.:get_columnsget_foreign_keysget_pk_constraintget_schema_namesget_transaction_modeget_unique_constraintsteradatasqlalchemy 17.0.0.4Added ART Table support forget_columnsAPI.teradatasqlalchemy 17.0.0.3Resolved a minor bug.teradatasqlalchemy 17.0.0.2Added support for below Teradata's datatypes:JSONXMLTDUDTGEOMETRYMBRMBBOptimised below APIshas_tablehas_viewget_table_namesget_view_namesMinor bug fixes.InstallationUse pip to install the Teradata SQL Driver Dialect for SQLAlchemy.PlatformCommandmacOS or Linuxpip install teradatasqlalchemyWindowspy -3 -m pip install teradatasqlalchemyWhen upgrading to a new version of the Teradata SQL Driver Dialect for SQLAlchemy, you may need to use pip install's--no-cache-diroption to force the download of the new version.PlatformCommandmacOS or Linuxpip install --no-cache-dir -U teradatasqlalchemyWindowspy -3 -m pip install --no-cache-dir -U teradatasqlalchemyLicenseUse of the Teradata SQL Driver Dialect for SQLAlchemy is governed by theLicense Agreement for the Teradata SQL Driver Dialect for SQLAlchemy.When the Teradata SQL Driver Dialect for SQLAlchemy is installed, theLICENSEfile is placed in theteradatasqlalchemydirectory under your Python installation directory.DocumentationWhen the Teradata SQL Driver Dialect for SQLAlchemy is installed, theREADME.mdfile is placed in theteradatasqlalchemydirectory under your Python installation directory. This permits you to view the documentation offline, when you are not connected to the Internet.TheREADME.mdfile is a plain text file containing the documentation for the Teradata SQL Driver Dialect for SQLAlchemy. While the file can be viewed with any text file viewer or editor, your viewing experience will be best with an editor that understands Markdown format.Using the Teradata SQL Driver Dialect for SQLAlchemyYour Python script must import thesqlalchemypackage in order to use the Teradata SQL Driver Dialect for SQLAlchemy.import sqlalchemyAfter importing thesqlalchemypackage, your Python script calls thesqlalchemy.create_enginefunction to open a connection to the Teradata Database.Specify the Teradata Database hostname as thehostcomponent of the URL. Note that COP Discovery is not implemented yet.The URL'shostcomponent may optionally be followed by a slash and question mark/?and the URL'squerycomponent consisting of connection parameters specified askey=valuepairs separated by ampersand&characters.The username and password may be specified as ahostprefix, or as connection URL parameters.Username and password specified as ahostprefix:eng = sqlalchemy.create_engine('teradatasql://guest:please@whomooz')Username and password specified as connection URL parameters:eng = sqlalchemy.create_engine('teradatasql://whomooz/?user=guest&password=please')Username and password specified as connection URL parameters take precedence over ahostprefix, if both are specified.Connection ParametersThe following table lists the connection parameters currently offered by the Teradata SQL Driver Dialect for SQLAlchemy.Our goal is consistency for the connection parameters offered by the Teradata SQL Driver Dialect for SQLAlchemy and the Teradata JDBC Driver, with respect to connection parameter names and functionality. For comparison, Teradata JDBC Driver connection parameters aredocumented here.ParameterDefaultTypeDescriptionaccountstringSpecifies the Teradata Database account. Equivalent to the Teradata JDBC DriverACCOUNTconnection parameter.column_namefalsebooleanControls the behavior of cursor.descriptionsequencenameitems. Equivalent to the Teradata JDBC DriverCOLUMN_NAMEconnection parameter. False specifies that a cursor.descriptionsequencenameitem provides the AS-clause name if available, or the column name if available, or the column title. True specifies that a cursor.descriptionsequencenameitem provides the column name if available, but has no effect when StatementInfo parcel support is unavailable.coptruebooleanSpecifies whether COP Discovery is performed. Equivalent to the Teradata JDBC DriverCOPconnection parameter.coplastfalsebooleanSpecifies how COP Discovery determines the last COP hostname. Equivalent to the Teradata JDBC DriverCOPLASTconnection parameter. Whencoplastisfalseor omitted, or COP Discovery is turned off, then no DNS lookup occurs for the coplast hostname. Whencoplastistrue, and COP Discovery is turned on, then a DNS lookup occurs for a coplast hostname.databasestringSpecifies the initial database to use after logon, instead of the user's default database. Equivalent to the Teradata JDBC DriverDATABASEconnection parameter.dbs_port1025integerSpecifies Teradata Database port number. Equivalent to the Teradata JDBC DriverDBS_PORTconnection parameter.encryptdatafalsebooleanControls encryption of data exchanged between the Teradata Database and the Teradata SQL Driver for Python. Equivalent to the Teradata JDBC DriverENCRYPTDATAconnection parameter.fake_result_setsfalsebooleanControls whether a fake result set containing statement metadata precedes each real result set.lob_supporttruebooleanControls LOB support. Equivalent to the Teradata JDBC DriverLOB_SUPPORTconnection parameter.log0integerControls debug logging. Somewhat equivalent to the Teradata JDBC DriverLOGconnection parameter. This parameter's behavior is subject to change in the future. This parameter's value is currently defined as an integer in which the 1-bit governs function and method tracing, the 2-bit governs debug logging, the 4-bit governs transmit and receive message hex dumps, and the 8-bit governs timing. Compose the value by adding together 1, 2, 4, and/or 8.logdatastringSpecifies extra data for the chosen logon authentication method. Equivalent to the Teradata JDBC DriverLOGDATAconnection parameter.logmechTD2stringSpecifies the logon authentication method. Equivalent to the Teradata JDBC DriverLOGMECHconnection parameter. Possible values areTD2(the default),JWT,LDAP,KRB5for Kerberos, orTDNEGO.max_message_body2097000integerNot fully implemented yet and intended for future usage. Equivalent to the Teradata JDBC DriverMAX_MESSAGE_BODYconnection parameter.partitionDBC/SQLstringSpecifies the Teradata Database Partition. Equivalent to the Teradata JDBC DriverPARTITIONconnection parameter.passwordstringSpecifies the Teradata Database password. Equivalent to the Teradata JDBC DriverPASSWORDconnection parameter.sip_supporttruebooleanControls whether StatementInfo parcel is used. Equivalent to the Teradata JDBC DriverSIP_SUPPORTconnection parameter.teradata_valuestruebooleanControls whetherstror a more specific Python data type is used for certain result set column value types.tmodeDEFAULTstringSpecifies the transaction mode. Equivalent to the Teradata JDBC DriverTMODEconnection parameter. Possible values areDEFAULT(the default),ANSI, orTERA.userstringSpecifies the Teradata Database username. Equivalent to the Teradata JDBC DriverUSERconnection parameter.