Skip to content
Snippets Groups Projects
Commit 3166dcc2 authored by Jacques Grelet's avatar Jacques Grelet
Browse files

use db.count instead of db.select

parent 85e4a33e
No related merge requests found
...@@ -304,13 +304,14 @@ class FileExtractor: ...@@ -304,13 +304,14 @@ class FileExtractor:
# print infos after reding all files # print infos after reding all files
hdr = self.db.query('SELECT * FROM station') hdr = self.db.query('SELECT * FROM station')
st = self.db.query('SELECT COUNT(id) FROM station') #st = self.db.query('SELECT COUNT(id) FROM station')
#print(f"SELECT COUNT({self.keys[0]}) FROM data") #print(f"SELECT COUNT({self.keys[0]}) FROM data")
max_press = self.db.query(f"SELECT COUNT({self.keys[0]}) FROM data") #max_size = self.db.query(f"SELECT COUNT({self.keys[0]}) FROM data")
n = self.db.count('station')
m = self.db.count('data')
# need more documentation about return dict from select # need more documentation about return dict from select
#print(max_press[0].keys()) #n = int(st[0]['COUNT(id)'])
n = int(st[0]['COUNT(id)']) #m = int(max_size[0][f"COUNT({self.keys[0]})"])
m = int(max_press[0][f"COUNT({self.keys[0]})"])
print(f"get sizes: {n} x {m}") print(f"get sizes: {n} x {m}")
# hdr is a list of dict, add station ? # hdr is a list of dict, add station ?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment