@wjmpantig/react-dbml-renderer 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # React DBML Renderer
2
+
3
+ A React component for rendering DBML (Database Markup Language) schemas.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @wjmpantig/react-dbml-renderer
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```tsx
14
+ import { DbmlRenderer } from "@wjmpantig/react-dbml-renderer";
15
+
16
+ function App() {
17
+ const schema = `
18
+ Table public.users {
19
+ id bigint [pk, increment]
20
+ email varchar(254) [not null, unique]
21
+ username varchar(50) [not null, unique]
22
+ password_hash varchar(255) [not null]
23
+ status user_status [not null, default: 'ACTIVE']
24
+ created_at timestamptz [not null, default: \`now()\`]
25
+ updated_at timestamptz [not null, default: \`now()\`]
26
+ referrer_id bigint [note: 'Self-ref: referral tree']
27
+
28
+ note: 'Application end users'
29
+ }
30
+ `;
31
+ return (
32
+ <div style={{ height: "100vh" }}>
33
+ <DbmlRenderer content={schema} />
34
+ </div>
35
+ );
36
+ }
37
+ ```