Skip to content

Commit f2038f4

Browse files
committed
Initial Commit
#1
1 parent a96a705 commit f2038f4

10 files changed

Lines changed: 686 additions & 2 deletions

Plugins.PostgreSql.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.PostgreSql", "src\FlowSynx.Plugins.PostgreSql.csproj", "{2502E381-8D23-4AE3-B933-C7C02AF2058D}"
7+
EndProject
8+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{B7D5764D-D2D8-422E-B52C-7A65C40B3776}"
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+
{2502E381-8D23-4AE3-B933-C7C02AF2058D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17+
{2502E381-8D23-4AE3-B933-C7C02AF2058D}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{2502E381-8D23-4AE3-B933-C7C02AF2058D}.Release|Any CPU.ActiveCfg = Release|Any CPU
19+
{2502E381-8D23-4AE3-B933-C7C02AF2058D}.Release|Any CPU.Build.0 = Release|Any CPU
20+
EndGlobalSection
21+
GlobalSection(SolutionProperties) = preSolution
22+
HideSolutionNode = FALSE
23+
EndGlobalSection
24+
GlobalSection(NestedProjects) = preSolution
25+
{2502E381-8D23-4AE3-B933-C7C02AF2058D} = {B7D5764D-D2D8-422E-B52C-7A65C40B3776}
26+
EndGlobalSection
27+
EndGlobal

README.md

Lines changed: 78 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,78 @@
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.
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="Npgsql" Version="9.0.3" />
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.PostgreSql.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.PostgreSql.Models;
4+
5+
public class PostgreSqlPluginSpecifications: PluginSpecifications
6+
{
7+
[RequiredMember]
8+
public string ConnectionString { get; set; } = string.Empty;
9+
}

0 commit comments

Comments
 (0)