Changelog
What each version brought. Preá is pre-alpha, and the API may change between versions until v1.
Each module has its own version. The CLI and the root module follow the newest one.
v0.0.5
October 2026
Modules: database v0.0.4; the root module and the CLI v0.0.5.
Database
prea_migrationskeeps each applied migration's version as written (0.0.1, not1), its name, a checksum of its SQL and when it ran. The first run converts the table of earlier versions, taking the names from the files.- An applied migration whose file was deleted, renamed, edited or replaced stops the app and
prea migrate, with the list of what doesn't match. Before, Preá ignored it, and a new file that took the version of a deleted one never ran. The checksum covers what ran, the part above-- prea:down. - Migrations only run forward: a pending migration older than the highest applied version, as after merging two branches, stops the app and
prea migrateuntil it gets a higher version. Before, it ran out of order.prea migrate downundoes from the highest version. - The migrations run on pgx directly, without goose.
v0.0.4
October 2026
Modules: security v0.0.3, database v0.0.3, logger v0.0.2; the root module and the CLI v0.0.4.
Security
- Each
security.Jwthas its own signing key. Build one withsecurity.NewJwt[T](secret); the process-wideSignKeyandSetSignKeyare gone, so two apps in the same process never share or overwrite a secret.prea.Runstill checkssecurity.jwt.secretat startup when it is set. Breaking: replacevar tokens security.Jwt[T]withNewJwt. HashPasswordandComparePasswordreject passwords longer than 128 bytes withsecurity.ErrPasswordTooLong, before argon2 runs, so a huge body can't burn CPU and memory.
Logs
- Text logs are colored in a terminal: debug in gray, info in green, success in bold green, warn in yellow and error in red, with the time dimmed. Files, pipes, the
jsonformat andNO_COLOR=1stay plain. - A new
warnlevel, between success and error, withlogger.Warn.
Database
- A migration written from the models is named after what it does, like
0.0.1_create_task_table.sql,0.0.2_alter_task_table.sqlor0.0.2_create_list_table_and_alter_task_table.sql, instead of<version>_models.sql. Migrations already written keep their names.
Docs
- The tutorial says which settings write the migrations from the models, and what to do when none appears.
Thanks to @Carlinnn and @MikaelDiogo for their first contributions.
v0.0.3
October 2026
HTTP
GETroutes also answerHEAD, with the same headers and no body.- A shutdown that runs past
server.shutdown_timeoutreturnscore.ErrShutdownTimeout, with a message that says what happened.
Database
- A foreign key column takes the type of the key it references:
ListID *stringwithfk:"list"is auuidcolumn, with notypetag. Createleaves nil pointers out, so the column default applies.- A value too long for its column, out of range or an invalid date is a 400, like other bad input.
- An invalid model reports only its own errors, without the foreign key errors that followed from it.
CLI
prea testsruns one package at a time: the packages share the test database.prea runandprea devforward every stop signal to the app, so an IDE's stop button,killor a closing terminal stop it gracefully.- Generated names follow Go initialisms (
APIKey), and the generated code is shorter, with grouped imports.
Docs
- This site, the tutorial and runnable examples on pkg.go.dev.
- Preá is now under the MIT License.
v0.0.2
October 2026
Run an app from its configuration
prea.Runstarts an app fromconfig/and the active profile: logs, database, migrations, token secret and server.prea.Testbuilds the app for a test, with thetestsprofile.- The server timeouts come from
server.*in the configuration. - The token secret is optional: an app that doesn't use tokens doesn't need it.
CLI
prea newcreates a project, with or without a database (--with-db).prea devruns the app and restarts it on every change.prea buildbuilds the binary intobin/.prea testsruns the tests with thetestsprofile.
Components
- A missing dependency is a typed error,
*di.MissingError, and a repository without a database says to setdatabase.url.
v0.0.1
October 2026
The first version.
- Preás and components, with
inject:"",value:"", named components, exports and imports, andInit/Close. - Configuration with profiles,
.envand environment variables. - HTTP: routes, middlewares at three levels, the standard reply, errors with a status, CORS, CSRF, security headers and graceful shutdown.
- Database for PostgreSQL: models described by tags, repositories, named-parameter queries, transactions, schema checks and migrations written from the models.
- Security: signed tokens and password hashing.
- Logs: four levels, text or JSON, one line per request.
- CLI:
prea run,prea generateandprea migrate. - Modules: the framework is split into Go modules, each with its own version.