Qualify pinned database identity and restricted MySQL backup profile
ABSDEV Framework CI / framework-ci (push) Successful in 24s
ABSDEV Framework CI / framework-ci (push) Successful in 24s
This commit is contained in:
+11
-2
@@ -49,6 +49,12 @@ class DatabaseAdapter(ABC):
|
||||
def identity_command(self):
|
||||
pass
|
||||
|
||||
def live_identity_command(self):
|
||||
return self.identity_command()
|
||||
|
||||
def backup_inventory_command(self):
|
||||
return None
|
||||
|
||||
@abstractmethod
|
||||
def backup_command(self):
|
||||
pass
|
||||
@@ -93,7 +99,7 @@ class DatabaseAdapter(ABC):
|
||||
return target
|
||||
|
||||
|
||||
def get_adapter(config):
|
||||
def get_adapter(config, *, mysql_read_only_backup=False):
|
||||
|
||||
try:
|
||||
|
||||
@@ -111,10 +117,13 @@ def get_adapter(config):
|
||||
|
||||
from adapters.mysql.adapter import MySQLAdapter
|
||||
|
||||
return MySQLAdapter(validated)
|
||||
return MySQLAdapter(validated, read_only_backup=mysql_read_only_backup)
|
||||
|
||||
if driver == "pgsql":
|
||||
|
||||
if mysql_read_only_backup:
|
||||
raise DatabaseError("MySQL backup option used for PostgreSQL")
|
||||
|
||||
from adapters.postgresql.adapter import PostgreSQLAdapter
|
||||
|
||||
return PostgreSQLAdapter(validated)
|
||||
|
||||
Reference in New Issue
Block a user