def connect(self, name):
self._name = name.rstrip("<STR_LIT>")<EOL>self._con = sqlite.connect(self._name + "<STR_LIT>")<EOL>self._cur = self._con.cursor()<EOL>self._tables = []<EOL>self._cur.execute("<STR_LIT>")<EOL>for r in self._cur: self._tables.append(r[<NUM_LIT:0>])<EOL>self._indices = []<EOL>self._cur.execute("<STR_LIT>")<EOL>for r in self._cur: self._indices.append(r[<NUM_LIT:0>])<EOL>for t in self._tables:<EOL><INDENT>self._cur.execute("<STR_LIT>"+t+"<STR_LIT:)>")<EOL>fields = []<EOL>key = "<STR_LIT>"<EOL>for r in self._cur:<EOL><INDENT>fields.append(r[<NUM_LIT:1>])<EOL>if r[<NUM_LIT:2>] == "<STR_LIT>": key = r[<NUM_LIT:1>]<EOL><DEDENT>setattr(self, t, Table(self, t, key, fields))<EOL><DEDENT>
Generic database.

        Opens the SQLite database with the given name.
        The .db extension is automatically appended to the name.
        For each table in the database an attribute is created,
        and assigned a Table object.

        You can do: database.table or database[table].