ARPA-SIMC / dballe

Fast on-disk database for meteorological observed and forecast data.
Other
19 stars 6 forks source link

documentation for dbadb #175

Closed lidiabressan closed 4 years ago

lidiabressan commented 5 years ago

ciao, I cannot find any more the documentation for dbadb. Some example on how to use dbadb could be useful (in addition to dbadb wipe).

In any case, this doesn't work any more, for some unknown reason (version 8.2-1.el7).

dbadb export year=2015 --dsn=sqlite:Onde/db_vecmaree_onde_2015_2018.parzpuliti.sqlite3 |dbadb import --dsn=sqlite:prova.sqlite
dbadb dump  --dsn=sqlite:prova.sqlite
cannot compile query 'SELECT id, memo, description, prio, descriptor, tablea FROM repinfo ORDER BY id':no such table: repinfo

A second try leaves prova.sqlite totally empty.

Someone can help? Please, add the answer in the documentation too, for next time reference. Thanks Lidia

pat1 commented 5 years ago

seems not initialized DB try to use dbadb wipe --dsn= or --wipe-first dbadb option on a new db

lidiabressan commented 5 years ago

Done that. It is an other problem.

[mare_exp@maialtest Verifica]$ dbadb wipe --dsn=sqlite:prova.sqlite
[mare_exp@maialtest Verifica]$ dbadb export year=2017 --dsn=sqlite:Onde/db_vecmaree_onde_2015_2018.parzpuliti.sqlite3 |dbadb import --dsn=sqlite:prova.sqlite
[mare_exp@maialtest Verifica]$ dbadb dump --dsn=sqlite:prova.sqlite
[mare_exp@maialtest Verifica]$ 
pat1 commented 5 years ago

expected results?

lidiabressan commented 5 years ago

i dati del 2017 in prova.sqlite

lidiabressan commented 5 years ago

The problem is in the data selection, without year=2018 works. Is there an example somewhere of how to do the selection?

From the --help: Usage: dbadb export [options] rep_memo [queryparm1=val1 [queryparm2=val2 [...]]]

$ dbadb wipe --dsn=sqlite:ciao.sqlite3 $ dbadb export --dsn=sqlite:archivio.sqlite3 | dbadb import --dsn=sqlite:ciao.sqlite3 $ dbinfo.py --times ciao.sqlite3 2014-12-30 2019-01-01 $ $ dbadb wipe --dsn=sqlite:ciao.sqlite3 $ dbadb export --dsn=sqlite:archivio.sqlite3 year=2018 | dbadb import --dsn=sqlite:ciao.sqlite3 $ dbinfo.py --times ciao.sqlite3 None None

$ dbadb wipe --dsn=sqlite:ciao.sqlite3 $ dbadb export --dsn=sqlite:archivio.sqlite3 year=2018 rep_memo=vecmaree | dbadb import --dsn=sqlite:ciao.sqlite3 $ dbinfo.py --times ciao.sqlite3 None None

lidiabressan commented 5 years ago

In one of the options I tried, something happened. I have a new error trying to wipe the sqlite??

$ dbadb wipe --dsn=sqlite:ciao.sqlite3 executing DROP TABLE IF EXISTS repinfo:FOREIGN KEY constraint failed

brancomat commented 5 years ago

without year=2018 works.

Ok,this might be related to #173 Try to explicit all date parameters (month, day, hour min and sec, see https://arpa-simc.github.io/dballe/parms.html)

lidiabressan commented 5 years ago

thanks, it works!

spanezz commented 5 years ago

Can this issue be closed?

lidiabressan commented 5 years ago

Before closing, can you before please clarify one thing in the documentation?

dbadb export --help Usage: dbadb export [options] rep_memo [queryparm1=val1 [queryparm2=val2 [...]]]

I think "rep_memo" in the help is a database. Or do you need to specify rep_memo (which is report now, or maybe network) in the command?

spanezz commented 5 years ago

Oops, good catch! That's a mistake in the command line summary. It should be like this instead, and I've now fixed it:

dbadb export --help
Usage: dbadb export [options] [queryparm1=val1 [queryparm2=val2 [...]]]

The database is specified with --url or with the DBA_DB environment variable.

lidiabressan commented 5 years ago

Please, add also the last line in the help.

spanezz commented 4 years ago

Good idea!