Sabokou / BigData

Apache License 2.0
1 stars 0 forks source link

Error while starting application: "LINE 1: SELECT * FROM books LIMIT 1" #11

Closed PatchFramework closed 3 years ago

PatchFramework commented 3 years ago

The Webapp errors on startup.

It looks like the problem is a combination of the init_db() and test() function in legerible.py.

init_db() executes init.sql which deletes all existing tables and then creates new ones.

test() checks if a SQL query can be executed and if not it calls init_db()

Usually it should be executed like so:

test() -> db not initilized yet -> init_db() -> db initilized -> test() -> success

In reality it is executed like so:

test() -> db not initilized yet -> init_db() -> test() -> ERROR -> db initilized -> test() -> success