Schemas used by the analyze code.

(ns metabase.analyze.schema
  (:require
   [metabase.util.malli.registry :as mr]
   [metabase.util.malli.schema :as ms]))
(mr/def ::no-kebab-case-keys (ms/MapWithNoKebabKeys))
(mr/def ::Table
  [:and
   (ms/InstanceOf :model/Table)
   ::no-kebab-case-keys])

Schema for a valid instance of a Metabase Table. Using this with mu/defn uses less memory than using (ms/InstanceOf :model/Table)

TODO: fix memory issues with mu/defn and ms/InstanceOf so we don't need to do this

(def Table
  [:ref ::Table])
(mr/def ::Field
  [:and
   (ms/InstanceOf :model/Field)
   ::no-kebab-case-keys])

Schema for a valid instance of a Metabase Field. Using this with mu/defn uses less memory than using (ms/InstanceOf :model/Field)

(def Field
  [:ref ::Field])