# PocketBase v0.40.0 — v0.40.0 Release - Product: PocketBase (https://whatsnew.fyi/product/pocketbase) - Vendor: PocketBase - Date: 2026-08-23 - Version: v0.40.0 - Original notes: https://github.com/pocketbase/pocketbase/releases/tag/v0.40.0 - Permalink: https://whatsnew.fyi/product/pocketbase/releases/v0.40.0 What's New is an index, not a publisher: every entry below links to the vendor's own release notes, which are the authoritative source. Entries are labelled where they are hand-curated sample data, pre-releases, or drawn from a secondary source such as a developer blog. Reuse: the summaries, labels and curation here are © What's New. Quote freely with attribution and a link back; wholesale republication of the corpus is not permitted — terms: https://whatsnew.fyi/terms. The vendors' own release notes remain their publishers'. --- - **changed** — Propagate console command errors and recovered panics to app.Start() so that the program exits with non-zero code while still ensuring app.OnTerminate hook was triggered - **added** — Add quotes around the default Content-Disposition serving filename when a custom name with special characters is provided - **added** — Add Cross-Origin-Opener-Policy:same-origin to default security response headers - **added** — Add Record.GetInt64(field) helper method - **added** — Add Store.Keys() method that returns a slice with all store keys - **added** — Add DELETE /api/logs endpoint and UI control to delete all logs without changing the maxDays retention setting - **added** — Add new log settings option to limit the max Log.Data size saved in the database with truncation at ~16KB and max 8k characters for the log message - **added** — Add filesystem.NewWriter(key, opts) method to allow direct file creation from an io.Reader value - **added** — Add filesystem.OnNewWriter() hook to allow listening for new or to-be-created files - **added** — Add filesystem.OnDelete() hook to allow listening for deleted files - **changed** — Optimize backups to no longer transaction lock the database during backup generation - **changed** — Update modernc.org/sqlite to 1.57.0 and register by default the new _defensive=1 DSN query parameter to enable SQLite's defensive mode - **changed** — Bump minimum Go version to 1.27.0 and migrate to the new encoding/json/v2 package > _To update the prebuilt executable you can run `./pocketbase update`._ - Propagate console command errors and recovered panics to `app.Start()` so that the program can exit with non-zero code while still ensuring that `app.OnTerminate` hook was triggered _(responsible for the app graceful shutdown handling)_. _⚠️ Note that this could be a slight breaking change in case you are chaining PocketBase commands and relied on the previous `0` exit status for `Command.RunE` returned errors._ _Or in other words, if you have `./pocketbase invalid && someothercommand` and previously relied that `someothercommand` will be always executed then this is no longer the case and you'll have to adjust it or replace `&&` with `;`._ - Added quotes around the default `Content-Disposition` serving filename in case custom name with special characters is provided. - Added `Cross-Origin-Opener-Policy:same-origin` to the default security response headers. _This is an extra precaution to prevent tab-nabbing in case custom UI plugins use `target="_blank"` without `rel="noopener"`._ - Added `Record.GetInt64(field)` helper (note that the serializable max safe integer of the `number` field is ~2^53-1). - Added `Store.Keys()` method that returns a slice with all of the store keys. - Added new `DELETE /api/logs` endpoint and UI control to delete all logs without changing the `maxDays` retention setting. - Added new log settings option to limit the max `Log.Data` size that will be saved in the database (default to ~16KB). _This is an extra precaution for the cases when logging user supplied data without validating it beforehand._ _If the resulting `Log.Data` json is above the limit, it is truncated to the last valid decoded character and an extra `"__pb_truncated__":true` log data entry will be added.`_ _Additionally, for just in case the log message is also truncated at max 8k characters._ - Added new `filesystem` low-level helper methods: - `filesystem.NewWriter(key, opts)` to allow direct file create from an `io.Reader` value. - `filesystem.OnNewWriter()` hook to allow listening for new/to-be-created files _(it is not exposed in `core.App` instance for now to avoid introducing breaking changes)_. - `filesystem.OnDelete()` hook to allow listening for deleted files _(it is not exposed in `core.App` instance for now to avoid introducing breaking changes)_. - Optimized backups to no longer transaction lock the database during backup generation ([#7799](https://github.com/pocketbase/pocketbase/discussions/7799#discussioncomment-18108244)). - Updated `modernc.org/sqlite` to 1.57.0 and registered by default the new `_defensive=1` DSN query parameter to enable [SQLite's defensive mode](https://sqlite.org/c3ref/c_dbconfig_defensive.html#sqlitedbconfigdefensive). - Bumped the min Go version to 1.27.0 and migrated to the new `encoding/json/v2` package. _⚠️ Please note that Go 1.27.0 retrofitted `encoding/json` to use the v2 package under the hood but unfortunately is not fully backward compatible._ _I recommend to not push blindly an update on production and to test your PocketBase application first locally to see if everything works correctly._