-
Notifications
You must be signed in to change notification settings - Fork 70
feat!(CosmosStore): Azure.Cosmos 'V4' support / enable mocking Cosmos APIs #197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
bartelink
wants to merge
86
commits into
master
Choose a base branch
from
cosmossdk4
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 14 commits
Commits
Show all changes
86 commits
Select commit
Hold shift + click to select a range
0cd50f9
Target FSharp.Control.AsyncSeq 2.0.23
bartelink 48fea8d
Change Cosmos to netstandard2.1, tools to netcoreapp3.1
bartelink 59fda04
Make tests pass
bartelink 723c7d8
Reduce leniency on stored proc call
bartelink 3baeb3e
V4
bartelink fa23d16
Up to L365
bartelink bbd90c6
Correctly retrieve request charge from Azure.Core response types; Swi…
ylibrach 8485484
Migrate to new etag match predicate
ylibrach 65c27d6
Migrate from FeedIterator to IAsyncEnumerable
ylibrach 4aa3319
Only set gateway options when in Gateway mode
ylibrach 26fd82e
Add and use NewtonsoftJsonSerializer
ylibrach f2a0633
Rearrange files
ylibrach 482b797
Fix test RU limits
ylibrach a36e742
Remove Microsoft.Azure.Cosmos.Direct ref
bartelink f09a731
Change from byte[] payloads to STJ.JsonElement; Rewrite converters us…
ylibrach aec8068
Replace FSCodec.NewtonsoftJson with core FSCodec
ylibrach 2035d49
Remove NewtonsoftJsonSerializer
ylibrach b61e367
Update FsCodec to 2.0.1
ylibrach c37789d
Fully switch over to STJ
ylibrach 561e17c
Update tests
ylibrach c121ca2
Create Tutorial STJ codecs
ylibrach 48a874e
Create Store integration STJ codecs
ylibrach b231595
Move STJ code to Equinox
ylibrach dd97e50
Add FsCodec.STJ to Equinox
ylibrach 7973a73
Move FsCodec.STJ to Equinox.Core; Fix net461
ylibrach e2d3d6b
Pair codecs together with Event types
ylibrach 125e3b0
Pair codecs together with Event types
ylibrach a68f80a
Split resolvers into UTF8 and JsonElement
ylibrach 301fdc5
Remove unnecessary async block
ylibrach 1c92b08
Fix typo
ylibrach d95e121
Change to camelCase field names
ylibrach 4398d30
Move FsCodec dep to end
ylibrach 3fabd8f
Rearrange open statements
ylibrach b0a3a9b
Merge pull request #200 from jet/stj
ylibrach d599f6c
Fix ValueTask versioning
ylibrach a670bcd
Merge branch 'master' into cosmossdk4
bartelink b1f4f03
Abstract Cosmos clients and allow them to be provided by consumers
ylibrach 88ec2bf
Clean up CancellationToken usages
ylibrach c509a1b
Streamline clients
ylibrach 0a5a176
Move all initialization functions to separate module
ylibrach 4b92f85
Make abstractions more generic
ylibrach 618c535
Rename to EquinoxCosmosClientFactory
ylibrach 474575a
Fix spacing
ylibrach a423299
Add argument docs
ylibrach 138a01e
Inline map/bind 'help'ers
bartelink d7d92bb
Merge remote-tracking branch 'origin/master' into cosmossdk4
bartelink 4b84edd
Rebase on Codec logic extracted into FsCodec.System.Text.Json (#202)
bartelink cd998c8
Merge remote-tracking branch 'origin/master' into cosmossdk4
bartelink 5e42546
Merge branch 'master' of https://github.com/jet/equinox into cosmossdk4
ylibrach 28499e6
Remove net461 target from tests
ylibrach a2d742f
Fix various test issues
ylibrach 2f3cfaa
Provide options
ylibrach d044dfd
Merge with latest changes from cosmossdk4
ylibrach 6207c09
Merge branch 'client-abstractions' of https://github.com/jet/equinox …
ylibrach a188f69
Tip compression toggle through optional argument (#206)
ylibrach 0a7fa6d
Change container initialization to be explicitly called on demand
ylibrach d6637ee
Switch from Force() to Value
ylibrach 3374a6d
Rename Client to Operations
ylibrach a17704b
Remove Sdk from naming
ylibrach e4270f9
Rename to compressUnfolds for clarity
ylibrach 5f7469f
Merge pull request #203 from jet/client-abstractions
ylibrach 820db24
Target FsCodec 2.0.2-alpha.0.8
bartelink 634ae3d
Misc cleanup
bartelink a5374fb
Store.Operations ?
bartelink a94843a
Store* naming
bartelink 0b1a400
Move Converter out of type definitions
bartelink e40d9d9
Fix naming stragglers
bartelink 6a36d46
Add dump -b to enable overriding Cosmos MaxItems
bartelink ad1dae4
Merge branch 'master' into cosmossdk4
bartelink 18eb774
Merge remote-tracking branch 'origin/master' into cosmossdk4
bartelink 07c8492
Cosmos V4: Reduce initialization confusion (#208)
bartelink 1e24121
simplify GetContainer
bartelink 73fa4be
Merge remote-tracking branch 'origin/master' into cosmossdk4
bartelink 84c3b73
Cosmos -> CosmosStore and related renames (#216)
bartelink 358bbe2
Merge with FsCodec 2.1.0 release updates
bartelink 730079f
Remove CancellationToken.useOrCreate
bartelink 3b5cb66
Merge branch 'master' into cosmossdk4
bartelink d2e96f2
Implement pretty-printing for JsonElement
bartelink 511e122
Merge branch 'master' into cosmossdk4
bartelink 31c94ce
Tidy comments
bartelink 4eae601
Tidy
bartelink 6622026
Polish comments
bartelink 175eefc
Merge remote-tracking branch 'origin/master' into cosmossdk4
bartelink e7009b7
Upgrade to STJ 5.0 rc1
bartelink 75d4551
Fix json
bartelink 792e420
Really Fix json
bartelink File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| namespace Equinox.Cosmos.Store | ||
|
|
||
| open System.IO; | ||
| open System.Text; | ||
| open Azure.Cosmos.Serialization; | ||
| open Newtonsoft.Json; | ||
| open Newtonsoft.Json.Serialization; | ||
|
|
||
| type NewtonsoftJsonSerializer () = | ||
| inherit CosmosSerializer () | ||
|
|
||
| let encoding = new UTF8Encoding(false, true) | ||
| let serializer = JsonSerializer.Create() | ||
|
|
||
| override __.FromStream<'T> (stream: Stream): 'T = | ||
| use stream = stream | ||
|
|
||
| if typeof<Stream>.IsAssignableFrom(typeof<'T>) then | ||
| stream :> obj :?> 'T | ||
| else | ||
| use streamReader = new StreamReader(stream) | ||
| use jsonReader = new JsonTextReader(streamReader) | ||
| serializer.Deserialize<'T>(jsonReader) | ||
|
|
||
| override __.ToStream<'T> (input: 'T): Stream = | ||
| let payload = new MemoryStream() | ||
|
|
||
| ( | ||
| use streamWriter = new StreamWriter(payload, encoding = encoding, bufferSize = 1024, leaveOpen = true) | ||
| use jsonWriter = new JsonTextWriter(streamWriter) | ||
|
|
||
| jsonWriter.Formatting <- Formatting.None | ||
| serializer.Serialize(jsonWriter, input) | ||
| jsonWriter.Flush() | ||
| streamWriter.Flush() | ||
| ) | ||
|
|
||
| payload.Position <- 0L | ||
| payload :> Stream |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.