Integrate Snowflake with MuleSoft

For a detailed post on Snowflake, check here:

Create a Snowflake Warehouse and load data!
Check how to create a snowflake warehouse and load data.

Let's now integrate Snowflake with MuleSoft.

We will use the employee table created in the previous blog.

  1. Create a new mule application
  2. Add Database module
    add-database
  3. Create a generic database connection
    generic-db-config
  4. Add maven dependency
    maven-dependency
    You can copy paste the below dependency:
    <dependency>
        <groupId>net.snowflake</groupId>
        <artifactId>snowflake-jdbc</artifactId>
        <version>3.13.4</version>
    </dependency>
    
  5. Drag a select operation and insert query:
    select-operation
    select * from employees
    
  6. Add Transformation to prepare the final payload
    final-transformation
    %dw 2.0
    output application/json
    ---
    payload map ((employee, index) -> {
        employee_id: employee.ID,
        employee_name: employee.NAME,
        employee_age: employee.AGE
    })```
    
  7. Now we can run the app and hit the postman
    output

Hope you liked this integration with snowflake. Cheers. 🍻

Tirthankar Kundu

Tirthankar Kundu