Skip to content
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

Feature / Separate namespace support #316

Merged
merged 2 commits into from
Jun 7, 2021

Conversation

maxekman
Copy link
Member

@maxekman maxekman commented May 3, 2021

Description

BEWARE: After this PR repos/event stores are created with their FULL DB NAME and not prefix only, as it was before. To keep the old default DB name set it to prefix + "_default" when creating repos/event stores.

Moves all namespace support to a separate package namespace. The package contains an event store and repo with namespace support that uses any underlying event store and repo as storage. The factory function provided in the New...() methods is used to create event stores/repos the first time a namespace is used.

eventStore := NewEventStore(func(ns string) (eh.EventStore, error) {
	s, err := mongodb.NewEventStore("mongodb://", ns)
	if err != nil {
		return nil, err
	}
	return s, nil
})

Affected Components

  • Event Store
  • Repo
  • Context
  • Errors with previous namespace support

Related Issues

Solution and Design

Steps to test and verify

@coveralls
Copy link

coveralls commented May 3, 2021

Coverage Status

Coverage increased (+0.6%) to 69.279% when pulling a23bbc7 on maxekman:feature/separate-namespace-support into f3b6276 on looplab:main.

@maxekman maxekman force-pushed the feature/separate-namespace-support branch 4 times, most recently from a6c36c7 to 958901b Compare May 21, 2021 12:36
@maxekman maxekman force-pushed the feature/separate-namespace-support branch from 958901b to cecffe2 Compare May 27, 2021 14:23
@maxekman maxekman force-pushed the feature/separate-namespace-support branch from cecffe2 to 1eb86af Compare June 7, 2021 05:56
@maxekman maxekman force-pushed the feature/separate-namespace-support branch from 1eb86af to a23bbc7 Compare June 7, 2021 06:10
@maxekman maxekman marked this pull request as ready for review June 7, 2021 06:16
@maxekman maxekman merged commit 629dadc into looplab:main Jun 7, 2021
@maxekman maxekman deleted the feature/separate-namespace-support branch June 7, 2021 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants