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

Single HiLo id generator per document store #1054

Closed
oakio opened this issue Jul 23, 2018 · 12 comments
Closed

Single HiLo id generator per document store #1054

oakio opened this issue Jul 23, 2018 · 12 comments
Milestone

Comments

@oakio
Copy link
Contributor

oakio commented Jul 23, 2018

No description provided.

@mdissel
Copy link
Contributor

mdissel commented Aug 10, 2018

Resulting in unique ID's for each record in every table? If yes, nice enhancement 👍

@jeremydmiller
Copy link
Member

@oakio I'd be worried about contention if you do this. Why is this valuable?

@oakio
Copy link
Contributor Author

oakio commented Aug 10, 2018

The main reason is if I want to merge two tables into one, I will not have conflicts by id

@jeremydmiller
Copy link
Member

@oakio Okay, but this one is "I take pull requests";) Some kind of way to declare that the Hilo sequence is shared?

@mysticmind
Copy link
Member

mysticmind commented Apr 26, 2019

The main reason is if I want to merge two tables into one, I will not have conflicts by id

I would argue that this is not a typical use case Marten users would encounter on a regular basis. So going ahead and closing this.

@mysticmind
Copy link
Member

Follow on note, please have a look at https://dba.stackexchange.com/questions/193788/what-can-go-wrong-using-the-same-sequence-across-multiple-tables-in-postgres. I would veto this feature in Marten.

@mdissel
Copy link
Contributor

mdissel commented Oct 16, 2019

@mysticmind Would you accept a pull request that changes the current HiLoSequence behaviour to make it possible to override the entitiyname? by default the enitityname equals the doctype, but it can be overridden so you can have a sequence that is used by multiple tables.

@mdissel
Copy link
Contributor

mdissel commented Oct 16, 2019

@oakio have you already started working on this request?

@oakio
Copy link
Contributor Author

oakio commented Oct 16, 2019

@mdissel no

@mdissel
Copy link
Contributor

mdissel commented Oct 16, 2019

Still relevant for you?

@mdissel
Copy link
Contributor

mdissel commented Oct 16, 2019

At first sight it seems that this is necessary:

mdissel added a commit to mdissel/marten that referenced this issue Oct 16, 2019
@mysticmind
Copy link
Member

@mdissel yes, PRs are welcome :-) I notice that you have sent a PR, will review the same.

@oskardudycz oskardudycz added this to the 3.10.0 milestone Oct 17, 2019
mysticmind pushed a commit that referenced this issue Oct 19, 2019
…nce, see #1054 (#1370)

* See #1054, optionally global unique ID via HiLoSequence

* Change to use single hilo instance and add test

* fix test

* remove wrong test

* Add documentation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants