Information for: DEVELOPERS   PARTNERS

Database: Delete adaptor

The database delete adaptor allows SQL DELETE statements to be executed. The number of records deleted by the DELETE statement will be put into the output destination schema or public variable location.

Creating the adapter

Create a Database adaptor, and when it appears for configuration, in the Adaptor Action list, ensure you click Delete. For more information about creating or configuring adaptors, see Acquia Journey adaptors.

After you have created the adaptor, the DELETE query must be specified as a standard SQL expression. Acquia Journey uses the Python SQL Alchemy library to convert the SQL to the specific dialect of the database type, so you do not have to use database specific encoding such as backticks (`example`) for MySQL or square brackets ([example]) for Microsoft SQL. Acquia recommends as best practice to develop your query and ensure it returns the correct data in your usual database development tool before copying to Acquia Journey and parameterizing.

Final semi-colons are optional. You can split the query over several lines for readability purposes.

You can parameterize the query using %%paramName%% anywhere within the query. For example, the following query demonstrates how to select a subscriber record:

DELETE from appParams WHERE paramKey = '%%paramKey%%';

Strings included in WHERE clauses must use single ( ' ) or double ( " ) quotation marks. If the parameter is numeric, quotation marks are not required.

Whenever you change the query and add or remove a parameter, you must save your query by clicking Save Query / Update Parameters. Saving your query will identify all the parameters and will create a slot for the query in the Parameters list in the lower-left panel.

After you have specified parameter locations in your query, you can test your query. Acquia Journey will check your query before running the test. If the adaptor displayed in the example runs as expected, it will populate the schema with the number of deleted rows:

{ "dbResponse": 1 }

Validation warnings

Warning Description
Parameters each need a data source Every parameter in the query of the form %%param%% must map to an input data source