Definition at line 124 of file data_sources.py.
def data_sources.sqlite_schema.__init__ |
( |
|
self, |
|
|
|
sqlite_file_name |
|
) |
| |
Definition at line 126 of file data_sources.py.
133 cursor = connection.cursor()
134 if query_object ==
None:
136 tables = cursor.execute(
"select name from sqlite_master where type = 'table'")
139 table_to_columns = {}
140 for table
in tables.fetchall():
141 table_to_columns[table[0]] = []
143 columns = cursor.execute(
"pragma table_info(%s)" % table[0])
144 for column
in columns.fetchall():
145 table_to_columns[table[0]].
append(str(column[1]))
149 for table
in table_to_columns:
151 column_string =
",".
join(table_to_columns[table])
152 sql_query =
"select %s from %s" % (column_string, table)
153 results = cursor.execute(sql_query).fetchall()
154 for n
in range(0, len(results)):
155 results[n] =
dict(zip(table_to_columns[table], map(str, results[n])))
156 table_to_data[str(table)] = results
157 self.
_data = json_data_node.make(table_to_data)
159 sql_query = query_object.to_sql()
161 except IOError
as io:
boost::dynamic_bitset append(const boost::dynamic_bitset<> &bs1, const boost::dynamic_bitset<> &bs2)
this method takes two bitsets bs1 and bs2 and returns result of bs2 appended to the end of bs1 ...
static std::string join(char **cmd)