Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rabestro/sap-cds-erd
AWK script to create a ER diagram for SAP Cloud Application Programming Model
https://github.com/rabestro/sap-cds-erd
cds entity-relationship-diagram erdiagram mermaid-diagrams plantuml sap sap-cloud-platform script
Last synced: about 2 months ago
JSON representation
AWK script to create a ER diagram for SAP Cloud Application Programming Model
- Host: GitHub
- URL: https://github.com/rabestro/sap-cds-erd
- Owner: rabestro
- License: apache-2.0
- Created: 2023-01-11T17:18:58.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-20T08:07:20.000Z (4 months ago)
- Last Synced: 2024-08-20T10:08:42.949Z (4 months ago)
- Topics: cds, entity-relationship-diagram, erdiagram, mermaid-diagrams, plantuml, sap, sap-cloud-platform, script
- Language: CAP CDS
- Homepage:
- Size: 59.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE
Awesome Lists containing this project
README
= SAP CDS Entity Relationship Diagrams
:hide-uri-scheme:The small AWK script generate https://mermaid.js.org/[mermaid] Entity Relationship diagrams from SAP Cloud Application Programming Model files.
== How to run script
[source,shell]
----
gawk -f src/cds2erd.awk db/* > bookstore.mermaid
----Alternatively, you can move the script to the bin directory and make it executable:
[source,shell]
----
chmod +x cds2erd.awk
----In this case you can call the script without specifying an interpreter:
[source,shell]
----
cds2erd.awk schema.cds > schema.mermaid
----== Sample generated ER diagram
Below is the database schema from the project https://github.com/SAP-samples/cloud-cap-samples/[SAP Cloud CAP Samples Bookstore]
[source,mermaid]
----
erDiagram
Books {
String title
String descr
Integer stock
Decimal price
Currency currency
Decimal rating
TechnicalBooleanFlag isReviewable
}Authors {
String name
Date dateOfBirth
Date dateOfDeath
String placeOfBirth
String placeOfDeath
}Genres {
String name
String descr
Integer ID PK
}Notes {
String note
}Orders {
String OrderNo
User buyer
Decimal total
Currency currency
}OrderItems {
Integer quantity
Decimal amount
}Reviews {
Rating rating
String title
String text
}Orders |o--o{ OrderItems : ""
OrderItems |o--o| Books : ""
Genres }o--o| Genres : ""
Books |o--o{ Reviews : ""
Books |o--o| Genres : ""
Books }o--o| Authors : ""----