<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Thomas Karner</title>
    <description>The latest articles on Forem by Thomas Karner (@karnerth).</description>
    <link>https://forem.com/karnerth</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F978926%2F6554c113-3763-428a-bebc-95056ed93fcd.jpeg</url>
      <title>Forem: Thomas Karner</title>
      <link>https://forem.com/karnerth</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/karnerth"/>
    <language>en</language>
    <item>
      <title>Mermerd - Generate your ERD blazingly fast</title>
      <dc:creator>Thomas Karner</dc:creator>
      <pubDate>Fri, 30 Dec 2022 05:00:00 +0000</pubDate>
      <link>https://forem.com/karnerth/mermerd-generate-your-erd-blazingly-fast-2g7e</link>
      <guid>https://forem.com/karnerth/mermerd-generate-your-erd-blazingly-fast-2g7e</guid>
      <description>&lt;p&gt;Link to the project is &lt;a href="https://github.com/KarnerTh/mermerd" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why would I need it / Why should I care?
&lt;/h2&gt;

&lt;p&gt;Documenting stuff and keeping it updated is hard and tedious, but having the right documentation can help to make the right decisions. Mermerd was designed to be able to export an existing database schema in a format that can be used to prototype and plan new features based on the existing schema. The resulting output is an ERD in &lt;a href="https://mermaid-js.github.io/mermaid/#/entityRelationshipDiagram" rel="noopener noreferrer"&gt;Mermaid-Js&lt;/a&gt; format that can easily be updated and extended.&lt;/p&gt;

&lt;h2&gt;
  
  
  How does the Mermaid format look like?
&lt;/h2&gt;

&lt;p&gt;You write your diagrams in plain text and Mermaid will create them for you. All the details can be found on the official website &lt;a href="https://mermaid.js.org/syntax/entityRelationshipDiagram.html" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For example, a simple ERD can look like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;erDiagram
    CUSTOMER }|..|{ DELIVERY-ADDRESS : has
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;which will result in a diagram like this (you can click on the image to test it out yourself)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://mermaid.live/edit#pako:eNo9jssKwjAURH8l3HXtB2QnJgvBIjQqCNlcmqsNmlbSZCFp_t1YH7OaxZnhJOhGQ8CBvLB49ej0wEo2R3XYN7Jlea7rOTEhd9uTbM-rtRCtVIpx1uMEFTjyDq0pD-m91BB6cqSBl2rQ3zToIRcuPgwGksaG0QO_4H2iCjCGUT2HDnjwkX7QV-RP0TJqPp6Lbn4B0pQ7-A" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmermaid.ink%2Fimg%2Fpako%3AeNo9jssKwjAURH8l3HXtB2QnJgvBIjQqCNlcmqsNmlbSZCFp_t1YH7OaxZnhJOhGQ8CBvLB49ej0wEo2R3XYN7Jlea7rOTEhd9uTbM-rtRCtVIpx1uMEFTjyDq0pD-m91BB6cqSBl2rQ3zToIRcuPgwGksaG0QO_4H2iCjCGUT2HDnjwkX7QV-RP0TJqPp6Lbn4B0pQ7-A%3Ftype%3Dpng" alt="ERD" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why do I need Mermerd when Mermaid already exists?
&lt;/h2&gt;

&lt;p&gt;Mermerd is a small cli tool which generates a Mermaid diagram from an existing database. It supports an interactive cli, command line arguments and predefined run configurations. You can watch a small demo &lt;a href="https://user-images.githubusercontent.com/22556363/149669994-bd5cfd8d-670c-4f64-9fe9-4892866d6763.mp4" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Example usages would be&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# all parameters are provided via the interactive cli
mermerd

# same as previous one, but show all constraints even though the table of the resulting constraint was not selected
mermerd --showAllConstraints

# ERD is created via the provided run config
mermerd --runConfig yourRunConfig.yaml

# specify all connection properties so that only the table selection is done via the interactive cli
mermerd -c "postgresql://user:password@localhost:5432/yourDb" -s public

# same as previous one, but use all available tables without interaction
mermerd -c "postgresql://user:password@localhost:5432/yourDb" -s public --useAllTables

# same as previous one, but use a list of tables without interaction
mermerd -c "postgresql://user:password@localhost:5432/yourDb" -s public --selectedTables article,article_label
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you are interested you can check out the project: &lt;a href="https://github.com/KarnerTh/mermerd" rel="noopener noreferrer"&gt;mermerd&lt;/a&gt;&lt;/p&gt;

</description>
      <category>softwareengineering</category>
      <category>discuss</category>
    </item>
  </channel>
</rss>
