Repository navigation
Tags
Tags
Merge pull request #3 from dnsoa/fix/ci-and-drop-legacy-migrations fix(sync)+refactor(sqldb): unflake the pool test, stop hiding module failures, drop the legacy migrations upgrade
fix(sqldb): rebuild table on SQLite in legacy migrations upgrade SQLite does not support ALTER TABLE ... ADD PRIMARY KEY, so the previous in-place upgrade silently left the table without a primary key and the subsequent upsert failed with "ON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint". Rebuild the table on SQLite instead, preserving the existing row. Co-Authored-By: Claude <noreply@anthropic.com>
add env.ReadMap Expose readFile as ReadMap so callers can parse a .env file into a map without mutating the process environment. Co-Authored-By: Claude <noreply@anthropic.com>
Apply fixQuery to migration SQL statements for flavor-specific handli… …ng: 1 file(s)
fix(sqldb): isolate migration history per service in shared databases The migrations table used a single global version row, so multiple microservices sharing one database would skip or clobber each other's migrations (e.g. service A reaching "002" caused service B to skip its own "001"/"002"). The unscoped getCurrentVersion query also failed once the table held more than one row. Switch to a multi-row (service, version) layout keyed by a service namespace, exposed via WithMigrationService. Omitting it defaults to "default" so single-service apps keep working with zero config. Version values are now bound as parameters instead of string-interpolated, removing an SQL injection vector. BREAKING CHANGE: the migrations table schema changes from (version text) to (service, version, PK(service)). Existing databases with the old single-row table must drop/recreate the migrations table.
refactor(i18n): bounded cache, language negotiation, exported Localizer Breaking changes: - Remove in-memory per-user cache (SetUserLanguage etc.); apps store preferences themselves and inject via WithLanguage - Replace GetGlobalLanguage/ResetGlobalLanguage with Language() - Replace Locale()/SystemLocal with SystemLanguage() language.Tag - Export Localizer type; context key no longer exported New: - SetSupported + Match for Accept-Language negotiation via language.Matcher - Localizer cache bounded (supported-set size, or hard cap 256) to eliminate unbounded-growth DoS vector - Cross-platform system locale parsing (en_US.UTF-8 / en-US / C / POSIX) Tests: 16 cases, race-clean, 98.3% coverage
PreviousNext