update a lot of db-querys to work with a postgres database

Signed-off-by: portamx <support@portamx.com>