Produces text input for D2 to make a diagram of a given database, usually rendered with SVG.
# S3 method for database
d2(x, name = NA_character_, reference_level = c("attr", "relation"), ...)A scalar character, containing text input for D2.
a database.
a character scalar, giving the name of the schema, if any.
a character scalar, indicating the format to use for foreign key references. "relation" only specifies the relations involved; "attr" also specifies the attributes involved, one pair at a time.
further arguments passed to or from other methods.
Each relation in the database is presented as a set of rows, one for each attribute in the relation. These rows include information about the attribute classes.
Any foreign key references are represented by arrows between either the
attribute pairs or the relation pairs, depending on the value of
reference_level. This allows the output to be geared towards a
specific layout engine. Of the engines currently available for D2, Dagre can
not plot references between relation attributes, just the attributes
themselves, so using reference_level = "relation" prevents compound
foreign keys resulting in duplicate reference arrows. ELK and Tala
can plot between relation attributes, so the default reference_level =
"attr" works as intended.
The generic d2.