Skip to content
Snippets Groups Projects

Make Storage, Db, and tests more modular.

2 unresolved threads

To prepare for a new backend that doesn't use postgresql. First step toward #1306 (closed).

Test Plan

'tox' still runs the same tests, and doesn't fail.


Migrated from D631 (view on Phabricator)

Merge request reports

Closed by Phabricator Migration userPhabricator Migration user 6 years ago (Nov 7, 2018 5:49pm UTC)

Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
209 # elif self.cur is not None:
210 # return self.cur
211 else:
212 return self.conn.cursor()
213
214 def __init__(self, conn, pool=None):
215 """create a DB proxy
216
217 Args:
218 conn: psycopg2 connection to the SWH DB
219 pool: psycopg2 pool of connections
220
221 """
222 self.conn = conn
223 self.pool = pool
224
  • That will need a bump in storage and migration in other modules:

    ./swh-vault/.tox/py3/lib/python3.6/site-packages/swh/storage/tests/test_db.py:13:from swh.storage.db import Db
    ./swh-indexer/.tox/py3/lib/python3.6/site-packages/swh/storage/tests/test_db.py:13:from swh.storage.db import Db
    ./swh-storage/swh/storage/tests/test_db.py:13:from swh.storage.db import Db
    ./swh-lister/.tox/py3/lib/python3.6/site-packages/swh/storage/tests/test_db.py:13:from swh.storage.db import Db
    ./swh-journal/.tox/py3/lib/python3.6/site-packages/swh/storage/tests/test_db.py:13:from swh.storage.db import Db
  • Author Maintainer

    Do you want me to add an alias (with a DeprecationWarning)?

  • Please register or sign in to reply
  • 304 267
    305 268 @db_transaction_generator()
    306 269 def skipped_content_missing(self, content, db=None, cur=None):
    307 """List skipped_content missing from storage
    270 """List skipped_content missing from storage, ie. content
    271 that is known by the archive but not stored for some reason
  • Author Maintainer
    • Really move all pgsql-specific parts of Storage into PgStorage.
    • Apply @ardumont's comment
  • Author Maintainer
    • Add missing metaclass.
  • Author Maintainer
    • Move apply_options to BaseDb.
  • Author Maintainer
    • Add aliases with a DeprecationWarning for compatibility.
  • Author Maintainer

    Abandonned in favor of !110 (closed).

  • Author Maintainer

    Merge request was abandoned

  • closed

  • mentioned in merge request !110 (closed)

  • Please register or sign in to reply
    Loading