Datasets: several tables of rows at once, checked and generated against the registry, loaded into the database, kept as EDN. Needs test.check.
Datasets: several tables of rows at once, checked and generated against the registry, loaded into the database, kept as EDN. Needs test.check.
(dataset-generator registry)(dataset-generator registry opts)test.check generator of datasets satisfying dataset-schema. Options: :rows wanted per table (default 5), :except tables ("schema.table") to leave out (no kept table may reference them). Tables that came out short are listed in the dataset's metadata, see short-tables.
test.check generator of datasets satisfying dataset-schema. Options: :rows wanted per table
(default 5), :except tables ("schema.table") to leave out (no kept table may reference them).
Tables that came out short are listed in the dataset's metadata, see short-tables.(dataset-schema registry)Schema for {"schema.table" [row ...]} datasets: rows, primary keys, unique constraints and foreign keys checked across the registry's tables.
Schema for {"schema.table" [row ...]} datasets: rows, primary keys, unique constraints and
foreign keys checked across the registry's tables.(inserts registry dataset)(inserts registry dataset opts)HoneySQL INSERT maps for a dataset, one per table, in an order the database accepts: parents before the tables referencing them, and within a table rows before the rows referencing them. Enum values are cast to their type, json written and cast, arrays given their element type; time values are passed as they are (next.jdbc.date-time for the java.time ones); a column a row lacks is DEFAULT. A column the table does not have is an error. Option :on-conflict :nothing adds ON CONFLICT DO NOTHING, for a database that already holds some of the rows (seeded by migrations, say).
HoneySQL INSERT maps for a dataset, one per table, in an order the database accepts: parents before the tables referencing them, and within a table rows before the rows referencing them. Enum values are cast to their type, json written and cast, arrays given their element type; time values are passed as they are (next.jdbc.date-time for the java.time ones); a column a row lacks is DEFAULT. A column the table does not have is an error. Option :on-conflict :nothing adds ON CONFLICT DO NOTHING, for a database that already holds some of the rows (seeded by migrations, say).
(read-dataset path)The dataset write-dataset wrote, its short tables back in the metadata. Byte arrays compare by identity, so a dataset holding bytea values is not = to itself read back; its rows load the same.
The dataset write-dataset wrote, its short tables back in the metadata. Byte arrays compare by identity, so a dataset holding bytea values is not = to itself read back; its rows load the same.
EDN readers for the tags write-dataset uses; for edn/read-string on a written dataset.
EDN readers for the tags write-dataset uses; for edn/read-string on a written dataset.
(short-tables dataset){"schema.table" {:wanted n :got n :reasons [[reason count] ...]}} for the tables of a generated dataset that came out with fewer rows than wanted, with what their candidate rows failed on; nil when none did.
{"schema.table" {:wanted n :got n :reasons [[reason count] ...]}} for the tables of a
generated dataset that came out with fewer rows than wanted, with what their candidate rows
failed on; nil when none did.(write-dataset path dataset)Writes a dataset as EDN, one table per block and one row per line, java.time values and bytes under pgmalli's tags (#pgmalli/instant "...", #pgmalli/bytes "hex"), so a fixture generated once (with a seed) is kept in the repository and read back with read-dataset. The tables that came out short (short-tables) are written too, under :pgmalli/short.
Writes a dataset as EDN, one table per block and one row per line, java.time values and bytes under pgmalli's tags (#pgmalli/instant "...", #pgmalli/bytes "hex"), so a fixture generated once (with a seed) is kept in the repository and read back with read-dataset. The tables that came out short (short-tables) are written too, under :pgmalli/short.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |