def _get_db_table(self, data_path, extension):
<EOL>raise NotImplementedError("<STR_LIT>")<EOL>if extension == '<STR_LIT>':<EOL><INDENT>con = lite.connect('<STR_LIT>')<EOL>con.row_factory = lite.Row<EOL>cur = con.cursor()<EOL>with open(data_path, '<STR_LIT:r>') as f:<EOL><INDENT>sql = f.read()<EOL><DEDENT>cur.executescript(sql)<EOL><DEDENT>else:<EOL><INDENT>con = lite.connect(data_path)<EOL>con.row_factory = lite.Row<EOL>cur = con.cursor()<EOL><DEDENT>cur.execute(self.subset)<EOL>db_info = cur.fetchall()<EOL>try:<EOL><INDENT>col_names = list(db_info[<NUM_LIT:0>].keys())<EOL><DEDENT>except IndexError:<EOL><INDENT>raise lite.OperationalError("<STR_LIT>" %<EOL>(query_str, data_path))<EOL><DEDENT>converted_info = [tuple(x) for x in db_info]<EOL>dtypes=[type(x) if type(x) != str else '<STR_LIT>' for x in db_info[<NUM_LIT:0>]]<EOL>table = np.array(converted_info, dtype=list(zip(col_names, dtypes)))<EOL>con.commit()<EOL>con.close()<EOL>return table.view(np.recarray)<EOL>
Query a database and return query result as a recarray

Parameters
----------
data_path : str
    Path to the database file
extension : str
    Type of database, either sql or db

Returns
-------
table : recarray
    The database query as a recarray