Inserting and Updating Data in SQL

THIS PAGE
Inserting Data
Inserting Data
Updating Data
Testing and Validation

Managing data in an SQL database like MySQL or PostgreSQL is a common requirement in many workflows. Canonic's DB Query Node allows you to execute raw SQL queries directly from your workflow. This guide focuses on inserting and updating data using this node.

Inserting Data

To insert data into an SQL database:

  1. Add a DB Query Node: Place the node at the desired point in your workflow.
  2. Configure the Query: Input your SQL insert query. For example:
   INSERT INTO users (name, email) VALUES ('John Doe', 'john@example.com');

Screenshot

Inserting Data

To insert data into an SQL database:

  1. Test the Query: Ensure that the query correctly inserts the data into your database.

Updating Data

To update existing data:

  1. Add a DB Query Node: As with insert, place this node where the update needs to occur.
  2. Configure the Query: Write your SQL update query. For instance:
   UPDATE users SET name = 'Jane Doe' WHERE email = 'jane@example.com';

Screenshot

Testing and Validation

Testing the Query

  • Test the Query: Verify that the query updates the data as expected.

Running the Workflow

  • Run the Workflow: Execute the workflow to test the insertion and updating of data.

Validating Database Changes

  • Validate Database Changes: Check your SQL database to ensure that the records are inserted and updated correctly.

Note: Using the DB Query Node for SQL operations in Canonic workflows can significantly streamline database interactions. Proper setup, testing, and adherence to best practices ensure efficient and secure database operations.

Did you find what you were looking for?
πŸ‘
πŸ‘Ž
What went wrong?
Need more help?We have a thriving Discordcommunity that can help you with all things Canonic. β†’