Skip to content

Commit 71ca989

Browse files
committed
Initial commit
#1
1 parent f95f16d commit 71ca989

File tree

10 files changed

+686
-2
lines changed

10 files changed

+686
-2
lines changed

Plugins.Sqlite.sln

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.12.35728.132
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlowSynx.Plugins.Sqlite", "src\FlowSynx.Plugins.Sqlite.csproj", "{466CF7F6-511B-4383-B9A9-A5A21E6C0E8C}"
7+
EndProject
8+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{A3F3B36D-19C8-459A-A856-45829CFCD9B0}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|Any CPU = Debug|Any CPU
13+
Release|Any CPU = Release|Any CPU
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{466CF7F6-511B-4383-B9A9-A5A21E6C0E8C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17+
{466CF7F6-511B-4383-B9A9-A5A21E6C0E8C}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{466CF7F6-511B-4383-B9A9-A5A21E6C0E8C}.Release|Any CPU.ActiveCfg = Release|Any CPU
19+
{466CF7F6-511B-4383-B9A9-A5A21E6C0E8C}.Release|Any CPU.Build.0 = Release|Any CPU
20+
EndGlobalSection
21+
GlobalSection(SolutionProperties) = preSolution
22+
HideSolutionNode = FALSE
23+
EndGlobalSection
24+
GlobalSection(NestedProjects) = preSolution
25+
{466CF7F6-511B-4383-B9A9-A5A21E6C0E8C} = {A3F3B36D-19C8-459A-A856-45829CFCD9B0}
26+
EndGlobalSection
27+
EndGlobal

README.md

Lines changed: 90 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,90 @@
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.

src/FlowSynx.Plugins.Sqlite.csproj

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net9.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
</PropertyGroup>
8+
9+
<PropertyGroup Condition="'$(Configuration)'=='Release'">
10+
<DebugSymbols>False</DebugSymbols>
11+
<DebugType>None</DebugType>
12+
</PropertyGroup>
13+
14+
<ItemGroup>
15+
<PackageReference Include="FlowSynx.PluginCore" Version="1.3.0" />
16+
<PackageReference Include="Microsoft.Data.Sqlite" Version="9.0.7" />
17+
</ItemGroup>
18+
19+
<ItemGroup>
20+
<Compile Update="Resources.Designer.cs">
21+
<DesignTime>True</DesignTime>
22+
<AutoGen>True</AutoGen>
23+
<DependentUpon>Resources.resx</DependentUpon>
24+
</Compile>
25+
</ItemGroup>
26+
27+
<ItemGroup>
28+
<EmbeddedResource Update="Resources.resx">
29+
<Generator>ResXFileCodeGenerator</Generator>
30+
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
31+
</EmbeddedResource>
32+
</ItemGroup>
33+
34+
<ItemGroup>
35+
<None Update="flowsynx.png">
36+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
37+
</None>
38+
<None Update="README.md">
39+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
40+
</None>
41+
</ItemGroup>
42+
43+
</Project>

src/Models/InputParameter.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
namespace FlowSynx.Plugins.Sqlite.Models;
2+
3+
internal class InputParameter
4+
{
5+
public string Operation { get; set; } = string.Empty;
6+
public string Sql { get; set; } = string.Empty;
7+
public Dictionary<string, object>? Params { get; set; }
8+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using FlowSynx.PluginCore;
2+
3+
namespace FlowSynx.Plugins.Sqlite.Models;
4+
5+
public class SqlitePluginSpecifications: PluginSpecifications
6+
{
7+
[RequiredMember]
8+
public string ConnectionString { get; set; } = string.Empty;
9+
}

src/README.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
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.

src/Resources.Designer.cs

Lines changed: 81 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)