File tree Expand file tree Collapse file tree 1 file changed +18
-5
lines changed
Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change 55
66class FileXdb :
77
8- def __init__ (self , db_name ):
9- self . database = {}
10- self . db_name = db_name
8+ def __init__ (self , db_name : str , data_dir : str | None ):
9+ """
10+ Creates a Databased in ``data_dir`` Directory named `` db_name``.
1111
12- def collection (self , col_name ) -> Collection :
13- collection = Collection (self .database , self .db_name , col_name )
12+ If Database is already exists, interacts with that.
13+
14+ [Recommended]
15+ Don't add any file extension. ``FileXdb`` will create its own file extension ``fxdb``.
16+
17+ :param db_name: Name of Database without file extension.
18+ :param data_dir: Where the Database will be stored.
19+ """
20+
21+ self ._database = {}
22+ self ._db_name = db_name
23+ self ._data_dir = data_dir
24+
25+ def collection (self , col_name : str ) -> Collection :
26+ collection = Collection (self ._database , self ._db_name , col_name )
1427 # self.database[col_name] = collection
1528
1629 return collection
You can’t perform that action at this time.
0 commit comments