(generate-enum-str-kvp-keyword-map enum-strs-vec)
For each enum-str, returns a kvp of {enum-str enum-keyword} where enum-keyword has turned all '_' into '-', e.g. 'aussie_rules' -> :aussie-rules.
Choosing to not have this run at startup as makes init much more complicatd, so just run this when dev to get enums, and have them be hard-coded.
For each enum-str, returns a kvp of {enum-str enum-keyword} where enum-keyword has turned all '_' into '-', e.g. 'aussie_rules' -> :aussie-rules. Choosing to not have this run at startup as makes init much more complicatd, so just run this when dev to get enums, and have them be hard-coded.
(get-enum-from-keyword-inner in-map-atom in-keyword)
Want to have clj throw an exception when no matching clause as that will be a programmer error.
Want to have clj throw an exception when no matching clause as that will be a programmer error.
(get-enum-from-keyword-wrapper enum-name-keyword in-keyword)
(get-enum-str-from-keyword-inner in-map-atom in-keyword)
While honeysql is smart enough to convert enum to str, have to do taht manually myself to access it, want to have clj throw an exception when no matching clause as that will be a programmer error.
While honeysql is smart enough to convert enum to str, have to do taht manually myself to access it, want to have clj throw an exception when no matching clause as that will be a programmer error.
(get-enum-str-from-keyword-wrapper enum-name-keyword in-keyword)
(get-keyword-from-enum-str-inner in-map-atom in-str nilable?)
nilable means in-str can be nil
Want to have clj throw an exception when no matching clause as that will be a programmer error.
nilable means in-str can be nil Want to have clj throw an exception when no matching clause as that will be a programmer error.
(get-keyword-from-enum-str-wrapper enum-name-keyword in-str nilable?)
(initialize-db-enum-atoms db-spec enum-name-vec)
Gets all the enums list in this method from the db, and creates the enum-map-atom atom and puts it into the global map. Needs to be called before enums are used.
enum-name-vec is vec of strings
Gets all the enums list in this method from the db, and creates the enum-map-atom atom and puts it into the global map. Needs to be called before enums are used. enum-name-vec is vec of strings
(initialize-enum-map-atom in-map-atom enum-name enum-str-vec)
Modifies in-map-atom, needs to run as part of system init.
Modifies in-map-atom, needs to run as part of system init.
(postgres-enum->str pg-enum)
(str->postgres-enum* type value)
Generally only used for inserts, converting from string form of enum to db form of enum from http://naiquevin.github.io/using-postgresqls-enum-types-with-korma.html
Generally only used for inserts, converting from string form of enum to db form of enum from http://naiquevin.github.io/using-postgresqls-enum-types-with-korma.html
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close