By creating a connector, you can connect to DBs and SaaS.
Connectors can be created in both cloud and local environments, but using those created in the cloud environment allows you to use them as-is after deployment.
Create a connector from the “Connectors” tab on the dashboard.
3
Obtain Connection Name
Once created successfully, activate the use of the connector from the project details page and obtain the connection name.
4
Use Connector in SQL/Python
Use the connection name in SQL or Python files to utilize the connector.
For detailed connection methods, please refer to the section at the bottom of this page.
Copy
{{ config( connection="connection_name" )}}select * from table_name;
If a connector with the same name is defined in both the local and cloud environments, the local environment’s connector will be used.After deploying to the cloud, only the connectors defined in the cloud environment are used.
Morph provides integration with SaaS.
By using integration, you can focus on implementing business logic without having to implement authentication.You can obtain the access_token from the integration created in Python as follows.
Copy
import pandas as pdimport morphfrom morph import MorphGlobalContextfrom morph_lib.api import get_auth_token@morph.funcdef get_salesforce_opportunities(context: MorphGlobalContext) -> pd.DataFrame: access_token = get_auth_token("salesforce-connection-name") # ↓↓↓ call API with access_token ↓↓↓
For information on connecting to different types of SaaS, please refer to the following.