from . import impl_memory
from . import impl_mongo


def build(db_type, config={}):
  '''
  Creates and initializes the appropriate store based on the 'db_type'. The 'config' structure varies by
  implementation.
  '''

  if db_type == 'memory':
    return impl_memory.DB(**config)

  if db_type == 'mongo_db':
    return impl_mongo.DB(**config)

  raise Exception(f'DB type not supported: {db_type}')
