Skip to content

json_type insert option is parsed but has no effect in 13.7.2.1 #2172

Description

@ArturWieczorek

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:

  1. Wire json_type into the schema so text / jsonb / disable actually control the storage type of the JSON columns, or
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions