Repository navigation
Use JSONB columns for structured data - #1305
Merged
Merged
Conversation
wu-clan
force-pushed
the
feature/jsonb-columns
branch
from
November 12, 2026 06:32
0070075 to
fb8e335
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
fba 2.0.0 dropped MySQL support, so PostgreSQL is the only database the framework and its plugins run on. The generic
sa.JSONtype only existed to stay portable across databases, and on PostgreSQL it lands as thejsontype, which has two limitations:json @> jsonbfails withoperator does not exist, so an array containment query needs an explicit cast, and casting the column also disables the indexpostgresql.JSONBstores the parsed form, supports@>and JSONPath directly, and can be indexed with GIN.The three remaining generic JSON columns in the base apps also carried a data shape that did not match their declared type: the scheduler serialised its arguments with
json.dumpsbefore writing them into a JSON column, so the column held a JSON string that had to be decoded again on read.Changes
sys_opera_log.argsbecomesJSONB, and its annotation matches the dictionary the middleware actually writestask_scheduler.argsandtask_scheduler.kwargsbecomeJSONB, and the annotations match the list and the dictionary they holdjson.loadsVerification
ruff check --no-fix backend/appandruff format --check backend/apppassfba init, so the columns are created asJSONBdirectly