This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-04-02
Channels
- # announcements (1)
- # architecture (1)
- # aws (21)
- # babashka (37)
- # beginners (173)
- # boot (12)
- # chlorine-clover (5)
- # cider (36)
- # clara (11)
- # clj-kondo (25)
- # clojure (128)
- # clojure-europe (7)
- # clojure-finland (3)
- # clojure-germany (2)
- # clojure-nl (57)
- # clojure-uk (23)
- # clojurescript (71)
- # clojurex (1)
- # core-async (30)
- # core-typed (5)
- # cursive (35)
- # datomic (8)
- # duct (4)
- # emacs (8)
- # exercism (41)
- # fulcro (116)
- # jackdaw (4)
- # jobs-discuss (6)
- # juxt (4)
- # kaocha (16)
- # leiningen (14)
- # malli (5)
- # observability (4)
- # off-topic (2)
- # pathom (19)
- # pedestal (29)
- # re-frame (64)
- # reitit (18)
- # ring (8)
- # shadow-cljs (3)
- # sql (13)
- # tools-deps (32)
- # tree-sitter (5)
- # yada (17)
fixed a bug on collection type transformations, which turned maps into vectors. Will push a new SNAPSHOT to clojars as need it with reitit (which uses leiningen)
Presumably mailli schema properties are open? So I can specify a (new) key, that I use for my own purposes? Example: assign :postgres/type "some-postgres-type", later I walk schema and "make it so" via connection to database?
Apparently so, a test schema for a database table:
(def metadata-schema
[:map {:postgres/schema "slm"
:postgres/table "measurement_metadatas"}
[:id {:postgres/type :bigserial
:postgres/key :primary} int?]
[:instrument-id {:postgres/type :bigint
:postgres/null? false} int?]
[:datafile-id {:postgres/type :bigint
:postgres/null? false} int?]
[:seq {:postgres/type :integer
:postgres/null? false} int?]
[:origin {:postgres/type :float8
:postgres/null? false} double?]
[:scale {:postgres/type :float4
:postgres/null? false} float?]
[:starting-timestamp {:postgres/type :timestamptz
:postgres/null? false} inst?] ;; TODO: fix
[:sample-rate {:postgres/type :float4
:postgres/null? false} float?]
[:log-interval {:postgres/type :float4
:postgres/null? false} float?]
[:weighting {:postgres/type :text
:postgres/null? false} string?]
[:manifest {:postgres/type :int
:postgres/null? false} int?]
[:time-zone {:postgres/type :int
:postgres/null? false} int?]])
And, as a quick experiment, wrote fn to print DDL text driven by the above, yielding:
CREATE TABLE slm.measurement_metadatas (
id bigserial PRIMARY KEY,
instrument_id bigint NOT NULL,
datafile_id bigint NOT NULL,
seq integer NOT NULL,
origin float8 NOT NULL,
scale float4 NOT NULL,
starting_timestamp timestamptz NOT NULL,
sample_rate float4 NOT NULL,
log_interval float4 NOT NULL,
weighting text NOT NULL,
manifest int NOT NULL,
time_zone int NOT NULL
);
🎉 8