├── .nuke
├── .tmp
├── build-attempt.log
└── shell-completion.yml
├── .gitignore
├── FunnyDB
├── FunnyDB.csproj
├── ISession.cs
├── DbSqlQueryParameter.cs
├── SqlQueryParameter.cs
├── ISqlResultSet.cs
├── SqlQueryExtensions.cs
├── SqlQuery.cs
├── SqlQueryValue.cs
├── Dialect.cs
├── SqlQueryResult.cs
└── SqlQueryLinter.cs
├── FunnyDB.Postgres
├── FunnyDB.Postgres.csproj
├── PgValue.cs
├── PgParameter.cs
└── Session.cs
├── FunnyDB.Test
├── FunnyDB.Test.csproj
├── SqlStrongTypeParametersTests.cs
├── SqlQueryReuseStatementsTest.cs
├── SqlLinterTests.cs
├── SqlQueryTests.cs
└── SqlIntegrationTest.cs
├── FunnyDB.Bench
└── CachedQueryVsGeneratedQuery.cs
├── license
├── FunnyDB.sln
└── readme.md
/.nuke:
--------------------------------------------------------------------------------
1 | FunnyDB.sln
--------------------------------------------------------------------------------
/.tmp/build-attempt.log:
--------------------------------------------------------------------------------
1 | 4ef7baa7e774856c52cae4ab3ddbc635
2 | Restore
3 | Compile
4 | Test
5 | Pack
6 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | **/.idea/
2 | *.suo
3 | *.user
4 | .vs/
5 | [Bb]in/
6 | [Oo]bj/
7 | _UpgradeReport_Files/
8 | [Pp]ackages/
9 |
10 | Thumbs.db
11 | Desktop.ini
12 | .DS_Store
--------------------------------------------------------------------------------
/FunnyDB/FunnyDB.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/FunnyDB/ISession.cs:
--------------------------------------------------------------------------------
1 | using System.Data;
2 |
3 | namespace FunnyDB
4 | {
5 | public interface ISession
6 | {
7 | IDbConnection Connection { get; }
8 | IDbTransaction Transaction { get; }
9 | void Commit();
10 | void Rollback();
11 | }
12 | }
--------------------------------------------------------------------------------
/FunnyDB.Postgres/FunnyDB.Postgres.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/.tmp/shell-completion.yml:
--------------------------------------------------------------------------------
1 | Configuration:
2 | - Debug
3 | - Release
4 | Continue:
5 | Help:
6 | Host:
7 | - AppVeyor
8 | - AzurePipelines
9 | - Bamboo
10 | - Bitrise
11 | - Console
12 | - GitHubActions
13 | - GitLab
14 | - Jenkins
15 | - TeamCity
16 | - Travis
17 | NoLogo:
18 | Plan:
19 | Root:
20 | Skip:
21 | - Clean
22 | - Compile
23 | - Pack
24 | - Restore
25 | - Test
26 | Target:
27 | - Clean
28 | - Compile
29 | - Pack
30 | - Restore
31 | - Test
32 | Verbosity:
33 | - Minimal
34 | - Normal
35 | - Quiet
36 | - Verbose
37 |
--------------------------------------------------------------------------------
/FunnyDB.Test/FunnyDB.Test.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp3.1
5 |
6 | false
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/FunnyDB.Bench/CachedQueryVsGeneratedQuery.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using BenchmarkDotNet.Attributes;
3 |
4 | namespace FunnyDB.Bench
5 | {
6 | [SimpleJob]
7 | public class CachedQueryVsGeneratedQuery
8 | {
9 | [GlobalSetup]
10 | public void Setup()
11 | {
12 | }
13 |
14 | // ReSharper disable once InconsistentNaming
15 | private static Func reusable(Func, SqlQuery> builder)
16 | {
17 | T1 p1Holder = default;
18 | SqlQuery query = null;
19 |
20 | var f = new Func(p1 =>
21 | {
22 | if (query == null)
23 | {
24 | query = builder(() => p1Holder);
25 | }
26 |
27 | p1Holder = p1;
28 | return query;
29 | });
30 |
31 | return f;
32 | }
33 | }
34 | }
--------------------------------------------------------------------------------
/FunnyDB.Postgres/PgValue.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using NpgsqlTypes;
3 |
4 | namespace FunnyDB.Postgres
5 | {
6 | public sealed class PgValue
7 | {
8 | public PgValue(NpgsqlDbType dbType, Func