def set_table(self, schema, **kwargs):
with self.connection(**kwargs) as connection:<EOL><INDENT>kwargs['<STR_LIT>'] = connection<EOL>if self.has_table(str(schema), **kwargs): return True<EOL>try:<EOL><INDENT>with self.transaction(**kwargs):<EOL><INDENT>self._set_table(schema, **kwargs)<EOL>for index_name, index in schema.indexes.items():<EOL><INDENT>self.set_index(<EOL>schema,<EOL>name=index.name,<EOL>fields=index.fields,<EOL>connection=connection,<EOL>**index.options<EOL>)<EOL><DEDENT><DEDENT><DEDENT>except InterfaceError:<EOL><INDENT>if not self.has_table(schema, **kwargs):<EOL><INDENT>raise<EOL><DEDENT><DEDENT><DEDENT>
add the table to the db

schema -- Schema() -- contains all the information about the table