@@ -52,6 +52,9 @@ class Storage(metaclass=StorageMeta):
5252
5353 :param read_only: Whether the synchronization algorithm should avoid writes
5454 to this storage. Some storages accept no value other than ``True``.
55+ :param implicit: Whether the synchronization shall create/delete collections
56+ in the destination, when these were created/removed from the source. Must
57+ be a possibly empty list of strings.
5558 """
5659
5760 fileext = ".txt"
@@ -75,9 +78,16 @@ class Storage(metaclass=StorageMeta):
7578 # The attribute values to show in the representation of the storage.
7679 _repr_attributes : List [str ] = []
7780
78- def __init__ (self , instance_name = None , read_only = None , collection = None ):
81+ def __init__ (self , instance_name = None , read_only = None , collection = None ,
82+ implicit = None ):
7983 if read_only is None :
8084 read_only = self .read_only
85+ if implicit is None :
86+ self .implicit = []
87+ elif isinstance (implicit , str ):
88+ self .implicit = [implicit ]
89+ else :
90+ self .implicit = implicit
8191 if self .read_only and not read_only :
8292 raise exceptions .UserError ("This storage can only be read-only." )
8393 self .read_only = bool (read_only )
@@ -119,6 +129,18 @@ async def create_collection(cls, collection, **kwargs):
119129 """
120130 raise NotImplementedError
121131
132+ @classmethod
133+ def delete_collection (cls , collection , ** kwargs ):
134+ '''
135+ Delete the specified collection and return the new arguments.
136+
137+ ``collection=None`` means the arguments are already pointing to a
138+ possible collection location.
139+
140+ The returned args should contain the collection name, for UI purposes.
141+ '''
142+ raise NotImplementedError ()
143+
122144 def __repr__ (self ):
123145 try :
124146 if self .instance_name :
0 commit comments