|
1 | | -# plugin-postgresql |
2 | | -FlowSynx plugin to interfaces with PostgreSQL for CRUD operations. Supports JSONB, full-text search, and advanced query features. |
| 1 | +# FlowSynx PostgreSQL Plugin |
| 2 | + |
| 3 | +The PostgreSQL Plugin is a pre-packaged, plug-and-play integration component for the FlowSynx engine. It enables executing PostgreSQL queries with configurable parameters such as connection strings, SQL templates, and runtime parameters. Designed for FlowSynx’s no-code/low-code automation workflows, this plugin simplifies database integration, data retrieval, and transformation tasks. |
| 4 | + |
| 5 | +This plugin is automatically installed by the FlowSynx engine when selected within the platform. It is not intended for manual installation or standalone developer use outside the FlowSynx environment. |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +## Purpose |
| 10 | + |
| 11 | +The PostgreSQL Plugin allows FlowSynx users to: |
| 12 | + |
| 13 | +- Execute parameterized SQL commands securely. |
| 14 | +- Retrieve data from PostgreSQL and pass it downstream in workflows. |
| 15 | +- Perform data transformation and filtering inline using SQL. |
| 16 | +- Integrate PostgreSQL operations into automation workflows without writing code. |
| 17 | + |
| 18 | +--- |
| 19 | + |
| 20 | +## Supported Operations |
| 21 | + |
| 22 | +- **query**: Executes a SQL SELECT query and returns the result set as JSON. |
| 23 | +- **execute**: Executes a SQL command (INSERT, UPDATE, DELETE, etc.) and returns the number of affected rows. |
| 24 | + |
| 25 | +--- |
| 26 | + |
| 27 | +## Plugin Specifications |
| 28 | + |
| 29 | +The plugin requires the following configuration: |
| 30 | +- ConnectionString (string): **Required.** The PostgreSQL connection string used to connect to the database. Example: |
| 31 | +``` |
| 32 | +Host=localhost;Port=5432;Username=postgres;Password=secret;Database=mydb |
| 33 | +``` |
| 34 | + |
| 35 | +--- |
| 36 | + |
| 37 | +## Input Parameters |
| 38 | + |
| 39 | +The plugin accepts the following parameters: |
| 40 | + |
| 41 | +- `Operation` (string): **Required.** The type of operation to perform. Supported values are query and execute. |
| 42 | +- `Sql ` (string): **Required.** The SQL query or command to execute. Use parameter placeholders (e.g., @id, @name) for dynamic values. |
| 43 | +- `Params` (object): Optional. A dictionary of parameter names and values to be used in the SQL template. |
| 44 | + |
| 45 | +### Example input |
| 46 | + |
| 47 | +```json |
| 48 | +{ |
| 49 | + "Operation": "query", |
| 50 | + "Sql": "SELECT id, name, email FROM users WHERE country = @country", |
| 51 | + "Parameters": { |
| 52 | + "country": "Norway" |
| 53 | + } |
| 54 | +} |
| 55 | +``` |
| 56 | + |
| 57 | +--- |
| 58 | + |
| 59 | +## Debugging Tips |
| 60 | + |
| 61 | +- Ensure the ConnectionString is correct and the database is accessible from the FlowSynx environment. |
| 62 | +- Use parameter placeholders (@parameterName) in the SQL to prevent SQL injection and enable parameterization. |
| 63 | +- Validate that all required parameters are provided in the Parameters dictionary. |
| 64 | +- If a query returns no results, verify that your SQL WHERE conditions are correct and the target table contains matching data. |
| 65 | + |
| 66 | +--- |
| 67 | + |
| 68 | +## Security Notes |
| 69 | + |
| 70 | +- SQL commands are executed using parameterized queries to prevent SQL injection. |
| 71 | +- The plugin does not store credentials or data outside of execution unless explicitly configured. |
| 72 | +- Only authorized FlowSynx platform users can view or modify configurations. |
| 73 | + |
| 74 | +--- |
| 75 | + |
| 76 | +## License |
| 77 | + |
| 78 | +© FlowSynx. All rights reserved. |
0 commit comments