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

Add own status and remove isXX() methods #726

Closed
vweevers opened this issue Oct 1, 2021 · 1 comment
Closed

Add own status and remove isXX() methods #726

vweevers opened this issue Oct 1, 2021 · 1 comment
Labels
semver-major Changes that break backward compatibility

Comments

@vweevers
Copy link
Member

vweevers commented Oct 1, 2021

Follow-up for TODO comments added in #725. Since that PR, the levelup interface has a status property the same as abstract-leveldown. It returns this.db.status.

Ideally levelup has its own status that is tracked separately from the underlying db. That way open events and externally seen status will be consistent. E.g. if the underlying db.status is initially 'open' (rather than 'new'), the levelup status should nevertheless be 'new', and the two states will "consolidate" upon open().

For API parity (Level/community#58) and simplicity, we should also prefer using db.status over these 3 utility methods: isOpen(), _isOpening() and isClosed(). Be aware that subleveldown uses those atm. Keep the isOperational() utility method because that expresses something different: whether operations can be made on the db regardless of its status.

@vweevers vweevers added the semver-major Changes that break backward compatibility label Oct 1, 2021
This was referenced Oct 2, 2021
vweevers added a commit that referenced this issue Oct 2, 2021
@vweevers
Copy link
Member Author

Closing for the same reasons as #728 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-major Changes that break backward compatibility
Projects
None yet
Development

No branches or pull requests

1 participant