This is an old ask but if you ran the query prior to dbeaver shutting down or you exiting it out you can go to Windows -> Views -> query manager and the query should be there