Skip to content

Commit

Permalink
Add a table of features to the readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamadden committed Oct 31, 2019
1 parent 0bb7bde commit 31001e7
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 9 deletions.
52 changes: 51 additions & 1 deletion README.rst
Expand Up @@ -67,6 +67,56 @@ currently supported. RelStorage replaced the PGStorage project.
.. _zodbpack: https://relstorage.readthedocs.io/en/latest/zodbpack.html_
.. _zodburi: https://relstorage.readthedocs.io/en/latest/zodburi.html

Features Supported by Databases
===============================

Some of RelStorage's features are only supported on certain versions
of certain databases. If the database doesn't support the feature,
RelStorage will still work, but possibly with a performance penalty.


.. list-table:: Supported Features
:widths: auto
:header-rows: 1
:stub-columns: 1

* -
- Parallel Commit
- Shared readCurrent locks
- Non-blocking readCurrent locks
- Streaming blobs
- Central transaction ID allocation
- Atomic lock and commit without Python involvement
* - PostgreSQL
- Yes
- Yes
- Yes
- With psycopg2 driver
- Yes
- Yes, except with PG8000 driver
* - MySQL
- Yes
- Yes
- Native on MySQL 8.0, emulated on MySQL 5.7
- No, emulated via chunking
- Yes
- Yes
* - Oracle
- Yes
- No
- Yes
- Yes
- No (could probably be implemented)
- No (could probably be implemented)
* - SQLite
- No
- No
- N/A (there is no distinction in lock types)
- No, consider using a shared-blob-dir
- N/A (essentially yes because it happens on one machine)
- No


===============
Documentation
===============
Expand All @@ -93,7 +143,7 @@ RelStorage is hosted at GitHub:
https://github.com/zodb/relstorage

Continuous integration
----------------------
======================

A test suite is run for every push and pull request submitted. Travis
CI is used to test on Linux, and AppVeyor runs the builds on
Expand Down
7 changes: 7 additions & 0 deletions src/relstorage/adapters/interfaces.py
Expand Up @@ -965,6 +965,13 @@ def deleteObject(cursor, oid_int, tid_int):
class IPoller(Interface):
"""Poll for new data"""

def get_current_tid(cursor):
"""
Returns the highest transaction ID visible to the cursor.
If there are no transactions, returns 0.
"""

def poll_invalidations(conn, cursor, prev_polled_tid):
"""
Polls for new transactions.
Expand Down
2 changes: 0 additions & 2 deletions src/relstorage/adapters/sql/query.py
Expand Up @@ -217,8 +217,6 @@ def execute(self, cursor, params=None):
cursor.execute(self._prepare_stmt)
params = self._prepare_converter(params)

__traceback_info__ = stmt, params

if params:
cursor.execute(stmt, params)
elif self.params:
Expand Down
10 changes: 4 additions & 6 deletions src/relstorage/cache/mvcc.py
Expand Up @@ -596,11 +596,10 @@ def __set_viewer_state_locked(self, cache, index):
if index is not None
else None)

def __initial_poll(self, cache, conn, cursor):
def __initial_poll(self, cache, cursor):
# Initial poll for the world.
change_iter, tid = cache.adapter.poller.poll_invalidations(conn, cursor, None)
tid = cache.adapter.poller.get_current_tid(cursor)

assert change_iter is None
new_index = None
if tid > 0:
# tid 0 is empty database, no data.
Expand All @@ -614,8 +613,7 @@ def __initial_poll(self, cache, conn, cursor):
self.__set_viewer_state_locked(cache, self.object_index)
# Regardless whether we or someone else did or did not
# get an index, the viewer gets our current state, and also
# gets told to invalidate everything.
return change_iter
# gets told to invalidate everything (implicit return None)

def _poll(self, cache, conn, cursor,
current_index,
Expand All @@ -624,7 +622,7 @@ def _poll(self, cache, conn, cursor,
# or it can return (None, old_tid) where old_tid is less than
# its third parameter (``prev_polled_tid``)
if current_index is None:
return self.__initial_poll(cache, conn, cursor)
return self.__initial_poll(cache, cursor)

# We have begun keeping an object index. But the cache
# may not yet. (See comments in _ObjectIndex docstring about
Expand Down
4 changes: 4 additions & 0 deletions src/relstorage/cache/tests/test_mvcc.py
Expand Up @@ -68,6 +68,10 @@ def setUp(self):
self.polled_tid = 0
self.polled_changes = None
self.viewer.adapter.poller.poll_invalidations = self.poll_invalidations
self.viewer.adapter.poller.get_current_tid = self.get_current_tid

def get_current_tid(self, _cursor):
return self.polled_tid

def poll_invalidations(self, conn, cursor, last_tid):
self.assertEqual(last_tid, self.expected_poll_last_tid)
Expand Down

0 comments on commit 31001e7

Please sign in to comment.