Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
94336c7
refactor(test): allow each implementation to specify the exact TimeSt…
the-avid-engineer Jul 31, 2022
66bfe82
feat: Postgres date time column supports microsecond precision
the-avid-engineer Jul 31, 2022
f2943aa
feat: postgres driver
the-avid-engineer Jul 31, 2022
fad8538
refactor(test): use TestContainers package instead of docker-compose …
the-avid-engineer Jul 31, 2022
69737d6
refactor: use getter/setter, remove redundant null assignment
the-avid-engineer Jul 31, 2022
86763b6
refactor: avoid magic constants
the-avid-engineer Jul 31, 2022
b2e76ec
refactor: avoid magic constants
the-avid-engineer Jul 31, 2022
bcb1286
refactor: reduce number of params
the-avid-engineer Jul 31, 2022
593f16a
refactor: appease codacy
the-avid-engineer Jul 31, 2022
eae83a8
refactor: de-duplicate json envelope logic
the-avid-engineer Jul 31, 2022
57bff38
refactor: reduce duplication
the-avid-engineer Aug 1, 2022
a11e417
refactor: reduce duplication?
the-avid-engineer Aug 1, 2022
ddd9f8b
refactor: reduce duplication
the-avid-engineer Aug 1, 2022
f4b4631
refactor: reduce duplication
the-avid-engineer Aug 1, 2022
d46c2a3
refactor: reduce duplication
the-avid-engineer Aug 1, 2022
a918c39
refactor: remove statics where not needed
the-avid-engineer Aug 1, 2022
9548711
bugfix: wrong property name
the-avid-engineer Aug 1, 2022
31cc97a
refactor: remove redundant initialization
the-avid-engineer Aug 1, 2022
83fcbdf
refactor: reduce duplication
the-avid-engineer Aug 1, 2022
3eb0f5c
refactor: implicit usings
the-avid-engineer Aug 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,6 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Start Redis
uses: supercharge/redis-github-action@1.2.0
with:
redis-version: 7.0.2
- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.7.0
with:
mongodb-version: 5.0.9
mongodb-replica-set: entitydb
- name: Install .NET SDK
uses: actions/setup-dotnet@v2
- name: Restore Dependencies
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/publish-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,6 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Start Redis
uses: supercharge/redis-github-action@1.2.0
with:
redis-version: 7.0.2
- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.7.0
with:
mongodb-version: 5.0.9
mongodb-replica-set: entitydb
- name: Install .NET SDK
uses: actions/setup-dotnet@v2
- name: Restore Dependencies
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/publish-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,6 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Start Redis
uses: supercharge/redis-github-action@1.2.0
with:
redis-version: 7.0.2
- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.7.0
with:
mongodb-version: 5.0.9
mongodb-replica-set: entitydb
- name: Install .NET SDK
uses: actions/setup-dotnet@v2
- name: Restore Dependencies
Expand Down
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<LangVersion>10.0</LangVersion>
<Nullable>enable</Nullable>
<EnablePreviewFeatures>True</EnablePreviewFeatures>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
Expand Down
31 changes: 29 additions & 2 deletions EntityDb.sln
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{92484C44-2754-4C1D-BD46-98D83E4020EE}"
ProjectSection(SolutionItems) = preProject
test\Directory.Build.props = test\Directory.Build.props
test\docker-compose.yml = test\docker-compose.yml
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EntityDb.Common.Tests", "test\EntityDb.Common.Tests\EntityDb.Common.Tests.csproj", "{CF316519-525E-4A67-BF12-1FDDF802B878}"
Expand All @@ -42,7 +41,15 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
global.json = global.json
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EntityDb.InMemory", "src\EntityDb.InMemory\EntityDb.InMemory.csproj", "{31C5BEDB-9B04-4FE4-9AF5-AE682C0E7643}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EntityDb.InMemory", "src\EntityDb.InMemory\EntityDb.InMemory.csproj", "{31C5BEDB-9B04-4FE4-9AF5-AE682C0E7643}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EntityDb.Npgsql", "src\EntityDb.Npgsql\EntityDb.Npgsql.csproj", "{2AADF21D-4F26-4BD6-852A-B28208863FDD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EntityDb.Npgsql.Provisioner", "src\EntityDb.Npgsql.Provisioner\EntityDb.Npgsql.Provisioner.csproj", "{282DFD9B-14E4-4339-B55A-3567E128FF1B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EntityDb.SqlDb", "src\EntityDb.SqlDb\EntityDb.SqlDb.csproj", "{F2491666-31D1-47B5-A493-F25E167D1FDF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EntityDb.Json", "src\EntityDb.Json\EntityDb.Json.csproj", "{4936FFE0-98E5-43A2-89C9-0415A13CAA9B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -98,6 +105,22 @@ Global
{31C5BEDB-9B04-4FE4-9AF5-AE682C0E7643}.Debug|Any CPU.Build.0 = Debug|Any CPU
{31C5BEDB-9B04-4FE4-9AF5-AE682C0E7643}.Release|Any CPU.ActiveCfg = Release|Any CPU
{31C5BEDB-9B04-4FE4-9AF5-AE682C0E7643}.Release|Any CPU.Build.0 = Release|Any CPU
{2AADF21D-4F26-4BD6-852A-B28208863FDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2AADF21D-4F26-4BD6-852A-B28208863FDD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2AADF21D-4F26-4BD6-852A-B28208863FDD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2AADF21D-4F26-4BD6-852A-B28208863FDD}.Release|Any CPU.Build.0 = Release|Any CPU
{282DFD9B-14E4-4339-B55A-3567E128FF1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{282DFD9B-14E4-4339-B55A-3567E128FF1B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{282DFD9B-14E4-4339-B55A-3567E128FF1B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{282DFD9B-14E4-4339-B55A-3567E128FF1B}.Release|Any CPU.Build.0 = Release|Any CPU
{F2491666-31D1-47B5-A493-F25E167D1FDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F2491666-31D1-47B5-A493-F25E167D1FDF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F2491666-31D1-47B5-A493-F25E167D1FDF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F2491666-31D1-47B5-A493-F25E167D1FDF}.Release|Any CPU.Build.0 = Release|Any CPU
{4936FFE0-98E5-43A2-89C9-0415A13CAA9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4936FFE0-98E5-43A2-89C9-0415A13CAA9B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4936FFE0-98E5-43A2-89C9-0415A13CAA9B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4936FFE0-98E5-43A2-89C9-0415A13CAA9B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -115,6 +138,10 @@ Global
{B8B6E5A5-5154-4629-9A38-9F0E65575F30} = {92484C44-2754-4C1D-BD46-98D83E4020EE}
{FA2AD2E9-84DA-4667-BF46-140B0B050563} = {92484C44-2754-4C1D-BD46-98D83E4020EE}
{31C5BEDB-9B04-4FE4-9AF5-AE682C0E7643} = {ABACFBCC-B59F-4616-B6CC-99C37AEC8960}
{2AADF21D-4F26-4BD6-852A-B28208863FDD} = {ABACFBCC-B59F-4616-B6CC-99C37AEC8960}
{282DFD9B-14E4-4339-B55A-3567E128FF1B} = {ABACFBCC-B59F-4616-B6CC-99C37AEC8960}
{F2491666-31D1-47B5-A493-F25E167D1FDF} = {ABACFBCC-B59F-4616-B6CC-99C37AEC8960}
{4936FFE0-98E5-43A2-89C9-0415A13CAA9B} = {ABACFBCC-B59F-4616-B6CC-99C37AEC8960}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E9D288EE-9351-4018-ABE8-B0968AEB0465}
Expand Down
5 changes: 1 addition & 4 deletions src/EntityDb.Abstractions/Agents/IAgentAccessor.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System.Threading;
using System.Threading.Tasks;

namespace EntityDb.Abstractions.Agents;
namespace EntityDb.Abstractions.Agents;

/// <summary>
/// Represents a type that can access an instance of <see cref="IAgent" />.
Expand Down
4 changes: 0 additions & 4 deletions src/EntityDb.Abstractions/Agents/IAgentSignatureAugmenter.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

namespace EntityDb.Abstractions.Agents;

/// <summary>
Expand Down
4 changes: 1 addition & 3 deletions src/EntityDb.Abstractions/Disposables/IDisposableResource.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;

namespace EntityDb.Abstractions.Disposables;
namespace EntityDb.Abstractions.Disposables;

/// <summary>
/// Marks a resource as disposable and provides a default implementation.
Expand Down
3 changes: 0 additions & 3 deletions src/EntityDb.Abstractions/Entities/IEntityRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
using EntityDb.Abstractions.Snapshots;
using EntityDb.Abstractions.Transactions;
using EntityDb.Abstractions.ValueObjects;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Threading;
using System.Threading.Tasks;

namespace EntityDb.Abstractions.Entities;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System.Threading;
using System.Threading.Tasks;

namespace EntityDb.Abstractions.Entities;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
using EntityDb.Abstractions.Snapshots;
using EntityDb.Abstractions.Transactions;
using EntityDb.Abstractions.ValueObjects;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Threading;
using System.Threading.Tasks;

namespace EntityDb.Abstractions.Projections;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System.Threading;
using System.Threading.Tasks;

namespace EntityDb.Abstractions.Projections;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using EntityDb.Abstractions.ValueObjects;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Linq.Expressions;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using EntityDb.Abstractions.ValueObjects;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Linq.Expressions;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using EntityDb.Abstractions.Leases;
using EntityDb.Abstractions.ValueObjects;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Linq.Expressions;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using EntityDb.Abstractions.Tags;
using EntityDb.Abstractions.ValueObjects;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Linq.Expressions;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.Diagnostics.CodeAnalysis;
using System.Linq.Expressions;

namespace EntityDb.Abstractions.Queries.SortBuilders;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.Diagnostics.CodeAnalysis;
using System.Linq.Expressions;

namespace EntityDb.Abstractions.Queries.SortBuilders;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using EntityDb.Abstractions.Leases;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Linq.Expressions;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using EntityDb.Abstractions.Tags;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Linq.Expressions;

Expand Down
3 changes: 0 additions & 3 deletions src/EntityDb.Abstractions/Snapshots/ISnapshotRepository.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
using EntityDb.Abstractions.Disposables;
using EntityDb.Abstractions.ValueObjects;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Threading;
using System.Threading.Tasks;

namespace EntityDb.Abstractions.Snapshots;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using EntityDb.Abstractions.Disposables;
using System.Threading;
using System.Threading.Tasks;

namespace EntityDb.Abstractions.Snapshots;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using EntityDb.Abstractions.ValueObjects;
using System.Threading;
using System.Threading.Tasks;

namespace EntityDb.Abstractions.Transactions.Builders;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@
using EntityDb.Abstractions.Queries;
using EntityDb.Abstractions.Tags;
using EntityDb.Abstractions.ValueObjects;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;

namespace EntityDb.Abstractions.Transactions;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using EntityDb.Abstractions.Disposables;
using System.Threading;
using System.Threading.Tasks;

namespace EntityDb.Abstractions.Transactions;

Expand Down
2 changes: 0 additions & 2 deletions src/EntityDb.Abstractions/ValueObjects/Id.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

namespace EntityDb.Abstractions.ValueObjects;

/// <summary>
Expand Down
14 changes: 12 additions & 2 deletions src/EntityDb.Abstractions/ValueObjects/TimeStamp.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Globalization;
using System.Globalization;

namespace EntityDb.Abstractions.ValueObjects;

Expand All @@ -9,6 +8,8 @@ namespace EntityDb.Abstractions.ValueObjects;
/// <param name="Value">The backing value.</param>
public readonly record struct TimeStamp(DateTime Value)
{
private const long TicksPerMicrosecond = TimeSpan.TicksPerMillisecond / 1000;

/// <summary>
/// The value of this constant is equivalent to 00:00:00.0000000 UTC, January 1, 1970.
/// </summary>
Expand All @@ -28,6 +29,15 @@ public TimeStamp WithMillisecondPrecision()
return new TimeStamp(Value - TimeSpan.FromTicks(Value.Ticks % TimeSpan.TicksPerMillisecond));
}

/// <summary>
/// Gets a <see cref="TimeStamp" /> rounded down to the nearest microsecond.
/// </summary>
/// <returns>A <see cref="TimeStamp" /> rounded down to the nearest microsecond.</returns>
public TimeStamp WithMicrosecondPrecision()
{
return new TimeStamp(Value - TimeSpan.FromTicks(Value.Ticks % TicksPerMicrosecond));
}

/// <summary>
/// Converts the value of the current <see cref="TimeStamp" /> object to
/// its equivalent string representation using the formatting
Expand Down
4 changes: 0 additions & 4 deletions src/EntityDb.Common/Agents/AgentAccessorChain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;

namespace EntityDb.Common.Agents;

Expand Down
2 changes: 0 additions & 2 deletions src/EntityDb.Common/Agents/AgentAccessorChainOptions.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using EntityDb.Abstractions.Agents;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;

namespace EntityDb.Common.Agents;

Expand Down
3 changes: 0 additions & 3 deletions src/EntityDb.Common/Agents/UnknownAgentAccessor.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using EntityDb.Abstractions.Agents;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

namespace EntityDb.Common.Agents;

Expand Down
4 changes: 1 addition & 3 deletions src/EntityDb.Common/Agents/UnknownAgentSignature.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Collections.Generic;

namespace EntityDb.Common.Agents;
namespace EntityDb.Common.Agents;

/// <summary>
/// Represents the signature of an unknown actor.
Expand Down
1 change: 0 additions & 1 deletion src/EntityDb.Common/Annotations/EntitiesAnnotation.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using EntityDb.Abstractions.Annotations;
using EntityDb.Abstractions.ValueObjects;
using System;

namespace EntityDb.Common.Annotations;

Expand Down
1 change: 0 additions & 1 deletion src/EntityDb.Common/Annotations/EntityAnnotation.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using EntityDb.Abstractions.Annotations;
using EntityDb.Abstractions.ValueObjects;
using System;

namespace EntityDb.Common.Annotations;

Expand Down
1 change: 0 additions & 1 deletion src/EntityDb.Common/Commands/IAddLeasesCommand.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using EntityDb.Abstractions.Leases;
using EntityDb.Abstractions.ValueObjects;
using EntityDb.Common.Transactions.Builders;
using System.Collections.Generic;

namespace EntityDb.Common.Commands;

Expand Down
1 change: 0 additions & 1 deletion src/EntityDb.Common/Commands/IAddTagsCommand.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using EntityDb.Abstractions.Tags;
using EntityDb.Abstractions.ValueObjects;
using EntityDb.Common.Transactions.Builders;
using System.Collections.Generic;

namespace EntityDb.Common.Commands;

Expand Down
1 change: 0 additions & 1 deletion src/EntityDb.Common/Commands/IDeleteLeasesCommand.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using EntityDb.Abstractions.Leases;
using EntityDb.Abstractions.ValueObjects;
using EntityDb.Common.Transactions.Builders;
using System.Collections.Generic;

namespace EntityDb.Common.Commands;

Expand Down
1 change: 0 additions & 1 deletion src/EntityDb.Common/Commands/IDeleteTagsCommand.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using EntityDb.Abstractions.Tags;
using EntityDb.Abstractions.ValueObjects;
using EntityDb.Common.Transactions.Builders;
using System.Collections.Generic;

namespace EntityDb.Common.Commands;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using EntityDb.Abstractions.Disposables;
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;

namespace EntityDb.Common.Disposables;

Expand Down
Loading