autocommit in config files
Summary
If autocommit is not explicitly set as true in the configuration files, its value is set as false, thus no data are inserted in the database.
What is the expected correct behavior?
In case autocommit is false, and we try to insert data in the DB, a warning should be flashed.
Additionally, the documentation should state that we should add autocommit : true in the config files.
Relevant logs and/or screenshots
2024-05-13 13:47:29,848 INFO sqlalchemy.engine.Engine [raw sql] {}
*********** insert {'date': datetime.date(2024, 4, 23), 'version': -1, 'site': 'CTA-NORTH', 'provenance': 'timestamp', 'season': 'WINTER'} in table SelectedAtmosphericModel
*********** connection <calibpipe.database.connections.calibpipe_database.CalibPipeDatabase object at 0x75e5884c74c0>
2024-05-13 13:47:29,850 INFO sqlalchemy.engine.Engine BEGIN (implicit)
2024-05-13 13:47:29,851 INFO sqlalchemy.engine.Engine INSERT INTO "SelectedAtmosphericModel" (date, provenance, season, site, version) VALUES (%(date)s::DATE, %(provenance)s::VARCHAR, %(season)s::VARCHAR, %(site)s::VARCHAR, %(version)s::VARCHAR)
2024-05-13 13:47:29,851 INFO sqlalchemy.engine.Engine [generated in 0.00015s] {'date': datetime.date(2024, 4, 23), 'provenance': 'timestamp', 'season': 'WINTER', 'site': 'CTA-NORTH', 'version': -1}
2024-05-13 13:47:29,852 INFO sqlalchemy.engine.Engine ROLLBACK
(vanilla_calibpipe) voutsi@voutsi-ThinkPad-T590:~/Work/calibpipe$ psql -U voutsi -d test4
psql (14.5)
Type "help" for help.
test4=# select * from "SelectedAtmosphericModel";
date | provenance | season | site | version
------+------------+--------+------+---------
(0 rows)
Edited by Georgios.Voutsinas