Question
doc/configuration.md shows json_type in the insert_options examples (e.g. "json_type": "text"), but setting it appears to do nothing. Is it still a supported option, or is it dead config that should be wired up or removed/documented?
Observed
db-sync 13.7.2.1 (git db8cdf6), preview and a local testnet. Recreated the database from scratch under each setting:
json_type: text -> the .json columns are jsonb
json_type: jsonb -> the .json columns are jsonb
The text and jsonb settings produce an identical schema. Columns checked:
tx_metadata.json, script.json, off_chain_pool_data.json, off_chain_vote_data.json (all stay jsonb, which is also the default).
Source
sioJsonType / JsonTypeConfig is defined and parsed in cardano-db-sync/src/Cardano/DbSync/Config/Types.hs (accepted values text, jsonb, disable; default JsonTypeText).
Grepping the tree, the only references to JsonType / sioJsonType are in that file plus the config-parse tests and a generator - there is no reference in any Schema, Migration, Insert or Query module.
So the value is validated and round-tripped in the config but never consumed, which matches the "no effect" behaviour above.
Resolution
Either:
- Wire
json_type into the schema so text / jsonb / disable actually control the storage type of the JSON columns, or
- If it is intentionally inert (superseded by
remove_jsonb_from_schema), document that and/or remove it from the config and the examples so users do not set an option that does nothing.
Question
doc/configuration.mdshowsjson_typein theinsert_optionsexamples (e.g."json_type": "text"), but setting it appears to do nothing. Is it still a supported option, or is it dead config that should be wired up or removed/documented?Observed
db-sync 13.7.2.1 (git db8cdf6), preview and a local testnet. Recreated the database from scratch under each setting:
json_type: text-> the.jsoncolumns arejsonbjson_type: jsonb-> the.jsoncolumns arejsonbThe
textandjsonbsettings produce an identical schema. Columns checked:tx_metadata.json,script.json,off_chain_pool_data.json,off_chain_vote_data.json(all stayjsonb, which is also the default).Source
sioJsonType/JsonTypeConfigis defined and parsed incardano-db-sync/src/Cardano/DbSync/Config/Types.hs(accepted valuestext,jsonb,disable; defaultJsonTypeText).Grepping the tree, the only references to
JsonType/sioJsonTypeare in that file plus the config-parse tests and a generator - there is no reference in any Schema, Migration, Insert or Query module.So the value is validated and round-tripped in the config but never consumed, which matches the "no effect" behaviour above.
Resolution
Either:
json_typeinto the schema sotext/jsonb/disableactually control the storage type of the JSON columns, orremove_jsonb_from_schema), document that and/or remove it from the config and the examples so users do not set an option that does nothing.