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

Metadata support #107

Open
vlopez opened this issue Nov 23, 2016 · 2 comments
Open

Metadata support #107

vlopez opened this issue Nov 23, 2016 · 2 comments
Labels

Comments

@vlopez
Copy link

vlopez commented Nov 23, 2016

Would it be possible to simply add an expires column to the table definition?
Instead of marshalling and adding it somehow into the k/v, just use that col to check if the entry has expired.

Is there some reason why it was not done this way?

@asppsa
Copy link
Collaborator

asppsa commented Dec 13, 2016

Hi there,

I think you are right that this would be possible -- the mongo adapter does something similar to this. If you feel like contributing a patch that does this, I think it would be gratefully received.

The only gotcha would be providing compatibility for people who have a table created with a previous version -- perhaps a migration, or a fallback for when the column is missing.

@asppsa asppsa added the Feature label Apr 18, 2018
@asppsa asppsa changed the title Expires native support for Sequel Metadata support Mar 5, 2019
@asppsa
Copy link
Collaborator

asppsa commented Mar 5, 2019

Having had a further think about this, I think the best way to implement this sort of thing would be to allow adapters to indicate that they support a "metadata" feature. The SQL-based adapters can do this via additional columns; the document stores via additional keys, etc. A wrapper class could be provided to give metadata support where the adapter does not support it natively (similar to the existing Expires wrapper). Metadata could include details such as a creation time, update time, user details, geographic details, etc.

Fallback support for expiry (where not natively supported) could then be implemented on top of this metadata functionality. In the SQL adapters, this would ultimately mean that a row's expiry could be stored in a specific column.

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

No branches or pull requests

2 participants