Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #4471 from matrix-org/erikj/sqlite_native_upsert
Browse files Browse the repository at this point in the history
Disable native upsert on sqlite
  • Loading branch information
erikjohnston committed Jan 25, 2019
2 parents 4a3f138 + 431e485 commit 57c035d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion changelog.d/4306.misc
@@ -1 +1 @@
Synapse will now take advantage of native UPSERT functionality in PostgreSQL 9.5+ and SQLite 3.24+.
Synapse will now take advantage of native UPSERT functionality in PostgreSQL 9.5+.
1 change: 1 addition & 0 deletions changelog.d/4471.misc
@@ -0,0 +1 @@
Synapse will now take advantage of native UPSERT functionality in PostgreSQL 9.5+.
10 changes: 7 additions & 3 deletions synapse/storage/engines/sqlite.py
Expand Up @@ -33,10 +33,14 @@ def __init__(self, database_module, database_config):
@property
def can_native_upsert(self):
"""
Do we support native UPSERTs? This requires SQLite3 3.24+, plus some
more work we haven't done yet to tell what was inserted vs updated.
Do we support native UPSERTs?
"""
return self.module.sqlite_version_info >= (3, 24, 0)
# SQLite3 3.24+ supports them, but empirically the unit tests don't work
# when its enabled.
# FIXME: Figure out what is wrong so we can re-enable native upserts

# return self.module.sqlite_version_info >= (3, 24, 0)
return False

def check_database(self, txn):
pass
Expand Down

0 comments on commit 57c035d

Please sign in to comment.