tableau / document-api-python

Create and modify Tableau workbook and datasource files
https://tableau.github.io/document-api-python/
MIT License
331 stars 177 forks source link

Changing Datasource Connection to another database #167

Open ismailsimsek opened 5 years ago

ismailsimsek commented 5 years ago

is it possible to change Data-source Connection to another database which has same table structure. would that break anything?

for example changing from PostgreSQL to Redshift or Redshift to snowflake

suryapsm commented 4 years ago

Hi, @ismailsimsek Did anyone found any solution for this? Is it possible to change connection type using any API? (I have to migrate from Teradata to Snowflake which have same table structures)

ismailsimsek commented 4 years ago

hi @suryapsm this is not official solution also not proven, but by looking at Connection it shuld be possible to change database by changing its class. again its not proven! even getting connection working datasource might get datatype issues/mismatches. IMO this is one of the most important feature tableau missing.

a sample PostgreSQL connection from datasource xml file

<named-connections>
  <named-connection caption='localhost' name='postgres.029sthq05ouun816ulker0cmf5s7'>
    <connection authentication='username-password' class='postgres' dbname='testdb' odbc-native-protocol='' one-time-sql='' port='5432' server='localhost' sslmode='require' username='testuser' />
  </named-connection>
</named-connections>