Create tables only when ensure_schema=True. Fixes #330.

This commit is contained in:
Friedrich Lindenberg 2020-06-28 15:44:42 +02:00
parent 2637254bcf
commit 17fffe78c2

View File

@ -228,6 +228,8 @@ class Database(object):
# you can also use the short-hand syntax: # you can also use the short-hand syntax:
table = db['population'] table = db['population']
""" """
if not self.ensure_schema:
return self.load_table(table_name)
return self.create_table(table_name, primary_id, primary_type) return self.create_table(table_name, primary_id, primary_type)
def __getitem__(self, table_name): def __getitem__(self, table_name):