Skip to content

Commit 2c30aa7

Browse files
committed
mv plugins
1 parent 02537b9 commit 2c30aa7

15 files changed

Lines changed: 44 additions & 43 deletions

File tree

NpgsqlRest.sln

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
2121
EndProject
2222
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BenchmarkTests", "BenchmarkTests\BenchmarkTests.csproj", "{2D8EAE94-E992-4CA0-BB86-91738ABB429B}"
2323
EndProject
24-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NpgsqlRest.HttpFiles", "NpgsqlRest.HttpFiles\NpgsqlRest.HttpFiles.csproj", "{7E06302A-C879-481E-A346-215BF150809D}"
25-
EndProject
2624
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AotBuildTemplate", "AotBuildTemplate\AotBuildTemplate.csproj", "{E05A79A7-C55A-4BD4-B62B-345A7DD1F80A}"
2725
EndProject
28-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NpgsqlRest.CrudSource", "NpgsqlRest.CrudSource\NpgsqlRest.CrudSource.csproj", "{5574DD14-5D0F-44A1-B9A3-FB6DC8054691}"
26+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "plugins", "plugins", "{168D4570-4DD0-4E85-83E4-889B7495370A}"
27+
EndProject
28+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NpgsqlRest.HttpFiles", "plugins\NpgsqlRest.HttpFiles\NpgsqlRest.HttpFiles.csproj", "{9D0D7807-9633-49A7-81D6-F2DD722DCC04}"
29+
EndProject
30+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NpgsqlRest.CrudSource", "plugins\NpgsqlRest.CrudSource\NpgsqlRest.CrudSource.csproj", "{94DF762B-9C25-4E27-95C6-DED177A2FDB0}"
2931
EndProject
3032
Global
3133
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -49,22 +51,26 @@ Global
4951
{2D8EAE94-E992-4CA0-BB86-91738ABB429B}.Debug|Any CPU.Build.0 = Debug|Any CPU
5052
{2D8EAE94-E992-4CA0-BB86-91738ABB429B}.Release|Any CPU.ActiveCfg = Release|Any CPU
5153
{2D8EAE94-E992-4CA0-BB86-91738ABB429B}.Release|Any CPU.Build.0 = Release|Any CPU
52-
{7E06302A-C879-481E-A346-215BF150809D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
53-
{7E06302A-C879-481E-A346-215BF150809D}.Debug|Any CPU.Build.0 = Debug|Any CPU
54-
{7E06302A-C879-481E-A346-215BF150809D}.Release|Any CPU.ActiveCfg = Release|Any CPU
55-
{7E06302A-C879-481E-A346-215BF150809D}.Release|Any CPU.Build.0 = Release|Any CPU
5654
{E05A79A7-C55A-4BD4-B62B-345A7DD1F80A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
5755
{E05A79A7-C55A-4BD4-B62B-345A7DD1F80A}.Debug|Any CPU.Build.0 = Debug|Any CPU
5856
{E05A79A7-C55A-4BD4-B62B-345A7DD1F80A}.Release|Any CPU.ActiveCfg = Release|Any CPU
5957
{E05A79A7-C55A-4BD4-B62B-345A7DD1F80A}.Release|Any CPU.Build.0 = Release|Any CPU
60-
{5574DD14-5D0F-44A1-B9A3-FB6DC8054691}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
61-
{5574DD14-5D0F-44A1-B9A3-FB6DC8054691}.Debug|Any CPU.Build.0 = Debug|Any CPU
62-
{5574DD14-5D0F-44A1-B9A3-FB6DC8054691}.Release|Any CPU.ActiveCfg = Release|Any CPU
63-
{5574DD14-5D0F-44A1-B9A3-FB6DC8054691}.Release|Any CPU.Build.0 = Release|Any CPU
58+
{9D0D7807-9633-49A7-81D6-F2DD722DCC04}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
59+
{9D0D7807-9633-49A7-81D6-F2DD722DCC04}.Debug|Any CPU.Build.0 = Debug|Any CPU
60+
{9D0D7807-9633-49A7-81D6-F2DD722DCC04}.Release|Any CPU.ActiveCfg = Release|Any CPU
61+
{9D0D7807-9633-49A7-81D6-F2DD722DCC04}.Release|Any CPU.Build.0 = Release|Any CPU
62+
{94DF762B-9C25-4E27-95C6-DED177A2FDB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
63+
{94DF762B-9C25-4E27-95C6-DED177A2FDB0}.Debug|Any CPU.Build.0 = Debug|Any CPU
64+
{94DF762B-9C25-4E27-95C6-DED177A2FDB0}.Release|Any CPU.ActiveCfg = Release|Any CPU
65+
{94DF762B-9C25-4E27-95C6-DED177A2FDB0}.Release|Any CPU.Build.0 = Release|Any CPU
6466
EndGlobalSection
6567
GlobalSection(SolutionProperties) = preSolution
6668
HideSolutionNode = FALSE
6769
EndGlobalSection
70+
GlobalSection(NestedProjects) = preSolution
71+
{9D0D7807-9633-49A7-81D6-F2DD722DCC04} = {168D4570-4DD0-4E85-83E4-889B7495370A}
72+
{94DF762B-9C25-4E27-95C6-DED177A2FDB0} = {168D4570-4DD0-4E85-83E4-889B7495370A}
73+
EndGlobalSection
6874
GlobalSection(ExtensibilityGlobals) = postSolution
6975
SolutionGuid = {C7C9B024-BFBB-414E-BD34-3CBF21C6C275}
7076
EndGlobalSection

NpgsqlRestTestWebApi/NpgsqlRestTestWebApi.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<ProjectReference Include="..\NpgsqlRest.CrudSource\NpgsqlRest.CrudSource.csproj" />
14-
<ProjectReference Include="..\NpgsqlRest.HttpFiles\NpgsqlRest.HttpFiles.csproj" />
1513
<ProjectReference Include="..\NpgsqlRest\NpgsqlRest.csproj" />
14+
<ProjectReference Include="..\plugins\NpgsqlRest.CrudSource\NpgsqlRest.CrudSource.csproj" />
15+
<ProjectReference Include="..\plugins\NpgsqlRest.HttpFiles\NpgsqlRest.HttpFiles.csproj" />
1616
</ItemGroup>
1717

1818
</Project>

NpgsqlRestTests/NpgsqlRestTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
</ItemGroup>
3030

3131
<ItemGroup>
32-
<ProjectReference Include="..\NpgsqlRest.CrudSource\NpgsqlRest.CrudSource.csproj" />
3332
<ProjectReference Include="..\NpgsqlRest\NpgsqlRest.csproj" />
33+
<ProjectReference Include="..\plugins\NpgsqlRest.CrudSource\NpgsqlRest.CrudSource.csproj" />
3434
</ItemGroup>
3535

3636
</Project>

NpgsqlRestTests/Setup/Program.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ public static void Main()
6060

6161
SourceCreated = sources =>
6262
{
63-
//sources.Add(new CrudSource());
64-
sources.Clear();
65-
sources.Add(new CrudSource(nameSimilarTo: "crud_insert_returning1"));
63+
sources.Add(new CrudSource());
64+
//sources.Clear();
65+
//sources.Add(new CrudSource(nameSimilarTo: "crud_insert_returning1"));
6666
},
6767
});
6868
app.Run();

NpgsqlRestTypes/NpgsqlRestTypes.csproj

Lines changed: 0 additions & 15 deletions
This file was deleted.

NpgsqlRest.CrudSource/CrudSource.cs renamed to plugins/NpgsqlRest.CrudSource/CrudSource.cs

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@ public class CrudSource(
4242
string[]? includeNames = null,
4343
string[]? excludeNames = null,
4444
string? query = null,
45-
CrudCommandType crudTypes = CrudCommandType.All) : IRoutineSource
45+
CrudCommandType crudTypes = CrudCommandType.All,
46+
string returningUrlPattern = "{0}/returning",
47+
string onConflictDoNothingUrlPattern = "{0}/on-conflict-do-nothing",
48+
string onConflictDoNothingReturningUrlPattern = "{0}/on-conflict-do-nothing/returning",
49+
string onConflictDoUpdateUrlPattern = "{0}/on-conflict-do-update",
50+
string onConflictDoUpdateReturningUrlPattern = "{0}/on-conflict-do-update/returning") : IRoutineSource
4651
{
4752
private readonly IRoutineSourceParameterFormatter _selectParameterFormatter = new SelectParameterFormatter();
4853
private readonly IRoutineSourceParameterFormatter _updateParameterFormatter = new UpdateParameterFormatter();
@@ -69,6 +74,11 @@ public class CrudSource(
6974
public bool InsertOnConflictDoUpdateReturning { get; init; } = (crudTypes & CrudCommandType.InsertOnConflictDoUpdateReturning) == CrudCommandType.InsertOnConflictDoUpdateReturning;
7075
public bool Delete { get; init; } = (crudTypes & CrudCommandType.Delete) == CrudCommandType.Delete;
7176
public bool DeleteReturning { get; init; } = (crudTypes & CrudCommandType.DeleteReturning) == CrudCommandType.DeleteReturning;
77+
public string ReturningUrlPattern { get; init; } = returningUrlPattern;
78+
public string OnConflictDoNothingUrlPattern { get; init; } = onConflictDoNothingUrlPattern;
79+
public string OnConflictDoNothingReturningUrlPattern { get; init; } = onConflictDoNothingReturningUrlPattern;
80+
public string OnConflictDoUpdateUrlPattern { get; init; } = onConflictDoUpdateUrlPattern;
81+
public string OnConflictDoUpdateReturningUrlPattern { get; init; } = onConflictDoUpdateReturningUrlPattern;
7282

7383
public IEnumerable<(Routine, IRoutineSourceParameterFormatter)> Read(NpgsqlRestOptions options)
7484
{
@@ -232,7 +242,7 @@ Routine CreateRoutine(
232242
fullDefinition: string.Concat(updateDef, returningExp),
233243
simpleDefinition: string.Concat(updateSimple, returningExp),
234244
isVoid: false,
235-
formatUrlPattern: "{0}/returning"),
245+
formatUrlPattern: ReturningUrlPattern),
236246
_updateParameterFormatter);
237247
}
238248

@@ -272,7 +282,7 @@ Routine CreateRoutine(
272282
fullDefinition: string.Concat(insertDef, returningExp),
273283
simpleDefinition: string.Concat(insertSimple, returningExp),
274284
isVoid: false,
275-
formatUrlPattern: "{0}/returning"),
285+
formatUrlPattern: ReturningUrlPattern),
276286
_insertParameterFormatter);
277287
}
278288

@@ -296,7 +306,7 @@ Routine CreateRoutine(
296306
fullDefinition: string.Concat(insertDef, onConflict, "do nothing"),
297307
simpleDefinition: string.Concat(insertSimple, onConflict, "do nothing"),
298308
isVoid: true,
299-
formatUrlPattern: "{0}/on-conflict-do-nothing"),
309+
formatUrlPattern: OnConflictDoNothingUrlPattern),
300310
_insertParameterFormatter);
301311
}
302312

@@ -309,7 +319,7 @@ Routine CreateRoutine(
309319
fullDefinition: string.Concat(insertDef, onConflict, "do nothing", returningExp),
310320
simpleDefinition: string.Concat(insertSimple, onConflict, "do nothing", returningExp),
311321
isVoid: false,
312-
formatUrlPattern: "{0}/on-conflict-do-nothing/returning"),
322+
formatUrlPattern: OnConflictDoNothingReturningUrlPattern),
313323
_insertParameterFormatter);
314324
}
315325

@@ -328,7 +338,7 @@ Routine CreateRoutine(
328338
fullDefinition: string.Concat(insertDef, onConflict, doUpdate),
329339
simpleDefinition: string.Concat(insertSimple, onConflict, doUpdate),
330340
isVoid: true,
331-
formatUrlPattern: "{0}/on-conflict-do-update"),
341+
formatUrlPattern: OnConflictDoUpdateUrlPattern),
332342
_insertParameterFormatter);
333343
}
334344

@@ -341,7 +351,7 @@ Routine CreateRoutine(
341351
fullDefinition: string.Concat(insertDef, onConflict, doUpdate, returningExp),
342352
simpleDefinition: string.Concat(insertSimple, onConflict, doUpdate, returningExp),
343353
isVoid: false,
344-
formatUrlPattern: "{0}/on-conflict-do-update/returning"),
354+
formatUrlPattern: OnConflictDoUpdateReturningUrlPattern),
345355
_insertParameterFormatter);
346356
}
347357
}
File renamed without changes.

NpgsqlRest.CrudSource/NpgsqlRest.CrudSource.csproj renamed to plugins/NpgsqlRest.CrudSource/NpgsqlRest.CrudSource.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
</ItemGroup>
4545

4646
<ItemGroup>
47-
<None Include="..\LICENSE">
47+
<None Include="..\..\LICENSE">
4848
<Pack>True</Pack>
4949
<PackagePath></PackagePath>
5050
</None>
@@ -58,6 +58,6 @@
5858
</ItemGroup>
5959

6060
<ItemGroup>
61-
<ProjectReference Include="..\NpgsqlRest\NpgsqlRest.csproj" />
61+
<ProjectReference Include="..\..\NpgsqlRest\NpgsqlRest.csproj" />
6262
</ItemGroup>
6363
</Project>
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)