Skip to content
Upgrading to v0.3

Upgrading to v0.3

Since v0.3.0

v0.3 is in progress; this page lists its breaking changes so far.

A database session in local time stops the app

Times are stored in UTC, and the app now checks at startup that the database session is in UTC too, so the database never writes local times (CURRENT_TIMESTAMP, NOW()) next to the app’s UTC ones.

Before: a DB_URL with a session time zone started:

DB_URL=postgres://app@db/app?timezone=Asia/Dhaka

After: the app and its commands stop with “the database session’s time zone is Asia/Dhaka, not UTC”. Remove timezone= (PostgreSQL) or time_zone= (MySQL) from DB_URL. For a legacy database whose times are local, keep it and set:

DB_ALLOW_LOCAL_TIMEZONE=true

The process’s local zone is the app’s

Importing Anetos sets Go’s local zone (time.Local) to APP_TIMEZONE, UTC when unset, whatever the machine’s zone or TZ. time.Now(), log lines and formatted times on a developer’s machine in another zone now show UTC. Set APP_TIMEZONE to keep a local zone; times are stored in UTC either way. See times and dates.

Binding messages

A value that can’t be converted to its field’s type (page=abc) is reported with the catalog’s binding.<kind> message, in the request’s language, instead of the converter’s text:

BeforeAfter
"page": "invalid integer \"abc\"""page": "must be an integer"
"draft": "must be a boolean" (JSON)"draft": "must be true or false"

Clients that match these strings need the new ones; change them for your app in a catalog (binding.integer).

Translations in projects made before v0.3

anetos make:auth writes its text to locales/en/auth.yaml and needs a locales folder. In a project made by an earlier anetos new, add it as Translations shows: a locales/locales.go embedding the folder, and i18n.ForApp(app, locales.FS) at the start of setup in main.go.

Once i18n.ForApp is called, the HTTP server handles a locale query parameter on page requests (a GET for HTML, not htmx) that names a supported locale: it stores the choice in a cookie and redirects without the parameter. A page route that reads its own locale parameter (a filter of content by language) should use another name. API requests and unsupported values reach your routes as before.