Skip to content

Commit 0e8ef91

Browse files
author
Jamil Maqdis Anton
committed
Break Version type into two separate files and add AppendStreamDetails and ReadStreamDetails types
1 parent f12c58e commit 0e8ef91

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

src/Types.fs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
namespace SqlStreamStore.FSharp
22

3-
open SqlStreamStore.Streams
4-
53
[<RequireQualifiedAccessAttribute>]
6-
type Version =
4+
type AppendVersion =
75
| Any
86
| EmptyStream
97
| NoStream
108
| SpecificVersion of int
119

12-
type StreamDetails =
10+
type AppendStreamDetails =
11+
{ streamName: string
12+
version: AppendVersion }
13+
14+
type ReadStreamDetails =
1315
{ streamName: string
14-
version: Version }
16+
version: ReadVersion }
17+
18+
and ReadVersion = uint
1519

1620
type StartPositionInclusive = int64
1721
type MessageCount = int
@@ -22,9 +26,9 @@ type AppendException =
2226
| Other of System.Exception
2327

2428
module Helpers =
25-
let toVersion: Version -> int =
29+
let getVersion: AppendVersion -> int =
2630
function
27-
| Version.Any -> ExpectedVersion.Any
28-
| Version.EmptyStream -> ExpectedVersion.EmptyStream
29-
| Version.NoStream -> ExpectedVersion.NoStream
30-
| Version.SpecificVersion version -> version
31+
| AppendVersion.Any -> SqlStreamStore.Streams.ExpectedVersion.Any
32+
| AppendVersion.EmptyStream -> SqlStreamStore.Streams.ExpectedVersion.EmptyStream
33+
| AppendVersion.NoStream -> SqlStreamStore.Streams.ExpectedVersion.NoStream
34+
| AppendVersion.SpecificVersion version -> version

0 commit comments

Comments
 (0)