This guide covers directly connecting Terrene to your database. It is not something we recommend but you can still do it. All the code in this guide should be run in a reducer.
Terrene supports SQLAlchemy outside of the box. To connect your database, please review their guide on creating an engine. In this example, we will connect to a Postgres database.
from sqlalchemy import create_engineengine = create_engine('postgresql+psycopg2://scott:[email protected]:5432/mydatabase')
content.to_sql("name_of_sql_table", con=engine, if_exists='replace')
After your code is complete, please create a custom code reducer and put the code in there. Then click on the settings icon on the top right corner
Then click on the "Convert to Atomic" button in the settings.
In supported data types, please select all options.
Finally, rename your custom code reducer to "Export to Database".
Then go to a TFrame you want to export, right click on any column, and then click on the "Export to Database".