GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — ReadStreamHeadPosition/Version by yreynhout · Pull Request #391 · SQLStreamStore/SQLStreamStore

This repository was archived by the owner on Aug 15, 2024. It is now read-only.

Conversation

@yreynhout

@yreynhout yreynhout commented May 4, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

This PR introduces two new methods on IReadonlyStreamStore (non-breaking change):

  • ReadStreamHeadPosition: reads the head position of a stream, i.e. the position of its last message
  • ReadStreamHeadVersion: reads the head version of a stream, i.e. the version of its last message

The test suite was extended with additional acceptance tests to cover the behavior of these new operations. This is the basis for a follow-up PR (in that it will follow a similar pattern) which will introduce support for reading the stream head message as well as the all stream head message.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
yreynhout added 3 commits May 23, 2020 11:22
@yreynhout
Designed core contract changes
4375694
@yreynhout
Introduced scripts for providers and trying to work out what the test…
7e8f174
… results should be.
@yreynhout
Rebased, extended sqlite with support for new operations, fixed copy/…
c7496ea
…paste mistakes, debugged failing tests and implemented fixes
@yreynhout
yreynhout force-pushed the read-stream-head-position-and-version branch from c16d742 to c7496ea Compare May 23, 2020 10:26
@yreynhout
yreynhout marked this pull request as ready for review May 23, 2020 10:31
yreynhout
yreynhout commented May 23, 2020
View reviewed changes
Comment thread src/SqlStreamStore.Http/HttpClientSqlStreamStore.cs
{
GuardAgainstDisposed();

return (await ReadStreamBackwards(streamId, StreamVersion.End, 1, false, cancellationToken)).LastStreamPosition;

@yreynhout yreynhout May 23, 2020

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this could be solved in a more optimized way for the http provider, please show me how.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
yreynhout
yreynhout commented May 23, 2020
View reviewed changes
Comment thread src/SqlStreamStore.Http/HttpClientSqlStreamStore.cs
{
GuardAgainstDisposed();

return (await ReadStreamBackwards(streamId, StreamVersion.End, 1, false, cancellationToken)).LastStreamVersion;

@yreynhout yreynhout May 23, 2020

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this could be solved in a more optimized way for the http provider, please show me how.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
yreynhout
yreynhout commented May 23, 2020
View reviewed changes
Comment thread src/SqlStreamStore.MsSql/MsSqlStreamStore.cs
@@ -280,13 +281,63 @@ protected override async Task<long> ReadHeadPositionInternal(CancellationToken c

if(result == DBNull.Value)

@yreynhout yreynhout May 23, 2020

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've left this in - but the test for the new operations seem to suggest this path will never be hit (since result is either null or a value, not DBNull.Value). Similar remark in other relational store implementations.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
thefringeninja
thefringeninja approved these changes May 23, 2020
View reviewed changes
@yreynhout
yreynhout merged commit ae0b72a into SQLStreamStore:master May 24, 2020
@yreynhout
yreynhout deleted the read-stream-head-position-and-version branch May 24, 2020 16:05
@yreynhout yreynhout mentioned this pull request Jul 2, 2020
Read(Stream)HeadMessage #426
Draft
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

1 more reviewer
@thefringeninja thefringeninja thefringeninja approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@yreynhout @thefringeninja
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.