For larger files, the more optimally it is edit the .sql file in an external editor and then in DBeaver:
- right-click on your DB
- chose Tools / Execute script
- load your .sql file
- click Start.
This approach is generally more convenient and faster for large files.
To do this without an external editor, you must:
- set your DB in Active datasource select
- load your file File / Open file …
- run the whole script e.g. using a shortcut Alt+X.