Skip to content

Commit 39bc0b1

Browse files
committed
Add option to not create database tables
1 parent d2bcd43 commit 39bc0b1

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

open_mastr/mastr.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ class Mastr:
7676
7777
"""
7878

79-
def __init__(self, engine="sqlite", connect_to_translated_db=False) -> None:
79+
def __init__(
80+
self, engine="sqlite", connect_to_translated_db=False, ensure_tables=True
81+
) -> None:
8082
validate_parameter_format_for_mastr_init(engine)
8183

8284
self.output_dir = get_output_dir()
@@ -102,7 +104,8 @@ def __init__(self, engine="sqlite", connect_to_translated_db=False) -> None:
102104
"'pip install --upgrade open-mastr'\n"
103105
)
104106

105-
orm.Base.metadata.create_all(self.engine)
107+
if ensure_tables:
108+
orm.Base.metadata.create_all(self.engine)
106109

107110
def download(
108111
self,

0 commit comments

Comments
 (0)