Foundation for v2 serialization and deserialization (#23204)
This supports serialization of only Collections and Settings so far, but it demonstrates the design of the new serialization system. `metabase.models.serialization.base` defines the multimethods, which are to be implemented by all the exported models eventually. The actual serialization code that drives the larger process is in `metabase_enterprise.serialization.v2.extract` and `.merge`, since serialization is an enterprise feature. The design calls for two matching phases on each side: - Serialization is extract + store; - Deserialization is ingest + load. Extract and load deal with vanilla Clojure maps with a `serdes/meta` key giving common details; they deliberately know nothing about files. Store and ingest deal with the storage medium and the process of listing and reading a stored export. Laziness is retained: the `load` process ingests full details on demand, so only the metadata of the importing database needs to fit in memory.
Showing
- enterprise/backend/src/metabase_enterprise/serialization/v2/extract.clj 18 additions, 0 deletions...kend/src/metabase_enterprise/serialization/v2/extract.clj
- enterprise/backend/src/metabase_enterprise/serialization/v2/ingest.clj 20 additions, 0 deletions...ckend/src/metabase_enterprise/serialization/v2/ingest.clj
- enterprise/backend/src/metabase_enterprise/serialization/v2/load.clj 92 additions, 0 deletions...backend/src/metabase_enterprise/serialization/v2/load.clj
- enterprise/backend/src/metabase_enterprise/serialization/v2/models.clj 6 additions, 0 deletions...ckend/src/metabase_enterprise/serialization/v2/models.clj
- enterprise/backend/test/metabase_enterprise/serialization/v2/extract_test.clj 71 additions, 0 deletions...est/metabase_enterprise/serialization/v2/extract_test.clj
- enterprise/backend/test/metabase_enterprise/serialization/v2/load_test.clj 133 additions, 0 deletions...d/test/metabase_enterprise/serialization/v2/load_test.clj
- src/metabase/models/collection.clj 53 additions, 0 deletionssrc/metabase/models/collection.clj
- src/metabase/models/interface.clj 3 additions, 1 deletionsrc/metabase/models/interface.clj
- src/metabase/models/serialization/base.clj 369 additions, 0 deletionssrc/metabase/models/serialization/base.clj
- src/metabase/models/setting.clj 12 additions, 1 deletionsrc/metabase/models/setting.clj
- test/metabase/api/dashboard_test.clj 2 additions, 2 deletionstest/metabase/api/dashboard_test.clj
- test/metabase/test/util.clj 1 addition, 1 deletiontest/metabase/test/util.clj
Loading
Please register or sign in to comment