Postico automatically saves queries you enter into the SQL editor.
Postico saves queries per favorite, per window or tab, and per database.
If you connect to the same favorite again, and open the same number of windows as in a previous session, and open the same database, Postico will show the queries from the last session.
Postico has a hidden preference to disable autosaving queries.
To disable autosaving, execute the following command in the Terminal:
defaults write at.eggerapps.Postico DontRestoreQueryViewText 1
Note that this does not delete previously autosaved queries from disk, it merely disables restoration and autosaving going forward.
Queries are saved as text files in the Application Support directory at the following path:
~/Library/Containers/at.eggerapps.Postico/Data/Library/Application Support/Postico/Autosave Queries
If you want to recover queries, check this directory.
Postico should be able to handle reasonably large SQL files, but we've received reports that the text rendering system can hang when Postico tries to restore very large autosaved queries. When this happens, you can check the autosave directory for large files, and remove them before starting Postico.
Old versions of Postico only saved queries from a single window (the last window you closed). This behavior was unexpected by most users, so we changed it.
Old versions of Postico stored autosaved queries in the connection favorite database, making them difficult to recover when you can't connect to the server.