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

custom timestamp #3

Open
ktmud opened this issue Mar 24, 2014 · 2 comments
Open

custom timestamp #3

ktmud opened this issue Mar 24, 2014 · 2 comments

Comments

@ktmud
Copy link

ktmud commented Mar 24, 2014

So if I read the code correctly, we can use

db.put(key, value, { version: timestamp })

to set custom timestamp for a record, instead of current Date?

How about make it explicit by alias options.version to options.timestamp?

db.put(key, value, { timestamp: ... })

It is also preferable if some option is provided to indicate that we are using timestamp as the version when creating an instance of level-version .

@brycebaril
Copy link
Owner

I would be fine adding an alias that maps options.timestamp to options.version

I'm not sure I follow the last part about level-version -- the default version stamp function in level-version is Date.now()

@ktmud
Copy link
Author

ktmud commented Apr 3, 2014

What I'm trying to say is, when timestreamdb creates a level-version instance, it depends on the version stamp to be a timestamp, but not explicitly asked it.

If this level-version is a totally 3rd party module, when its maintainer changes this default behavior, timestreamdb will break.

Also, by stating timestamp configuration both in creating and transforming, it will be easier to understand the code, without the need to dive into what does level-version secretly do.

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

No branches or pull requests

2 participants