|
1 | | -# plugin-sqlite |
2 | | -FlowSynx plugin to enables data access and manipulation on SQLite databases. |
| 1 | +# FlowSynx SQLite Plugin |
| 2 | + |
| 3 | +The SQLite Plugin is a pre-packaged, plug-and-play integration component for the FlowSynx engine. It enables executing SQLite queries with configurable parameters such as database file paths, 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 for lightweight, file-based databases. |
| 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 SQLite Plugin allows FlowSynx users to: |
| 12 | + |
| 13 | +- Execute parameterized SQL commands securely. |
| 14 | +- Retrieve data from SQLite and pass it downstream in workflows. |
| 15 | +- Perform data transformation and filtering inline using SQL. |
| 16 | +- Integrate SQLite 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 | +Data Source=C:\databases\flowdata.db |
| 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 file 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 `Params` 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 | +## SQLite Limitations |
| 69 | + |
| 70 | +When using SQLite within FlowSynx, keep the following considerations in mind: |
| 71 | + |
| 72 | +- **No Parallel Writes**: SQLite allows only one write operation at a time. If multiple workflows attempt to write simultaneously, you may encounter locking errors. Consider queueing or serializing writes in high-concurrency scenarios. |
| 73 | +- **File-based Database**: SQLite databases are single files. Ensure the file is on a filesystem accessible to the FlowSynx runtime. |
| 74 | +- **Data Type Affinity**: SQLite uses dynamic typing (data type affinity), meaning values are stored based on the content rather than strict column types. Validate data formats explicitly when interacting with other systems. |
| 75 | +- **Size and Performance**: SQLite is best suited for lightweight workloads. For large datasets or heavy concurrent access, consider using a server-based database (e.g., PostgreSQL, MySQL). |
| 76 | +- **In-Memory Databases**: If using an in-memory database (`:memory:`), the database contents exist only during the lifetime of the plugin execution and will not persist across operations. |
| 77 | + |
| 78 | +--- |
| 79 | + |
| 80 | +## Security Notes |
| 81 | + |
| 82 | +- SQL commands are executed using parameterized queries to prevent SQL injection. |
| 83 | +- The plugin does not store credentials or data outside of execution unless explicitly configured. |
| 84 | +- Only authorized FlowSynx platform users can view or modify configurations. |
| 85 | + |
| 86 | +--- |
| 87 | + |
| 88 | +## License |
| 89 | + |
| 90 | +© FlowSynx. All rights reserved. |
0 commit comments