'Create a new table in the sql database.
Raises SqlException if the table already exists.
Args:
name: Name of the table.
fields: A list of field names.
constraints: A dict mapping field names to constraint strings.'

def __init__(self, name, fields, constraints=None, parent=None):

    super().__init__(parent)
    self._name = name
    constraints = (constraints or {})
    column_defs = ['{}    {}'.format(field, constraints.get(field, '')) for field in fields]
    q = Query('CREATE    TABLE    IF    NOT    EXISTS    {name}    ({column_defs})'.format(name=name, column_defs=',    '.join(column_defs)))
    q.run()
