realitydb 2.0.0 → 2.0.14

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.
Files changed (5) hide show
  1. package/README.md +25 -140
  2. package/bin.js +13 -0
  3. package/package.json +15 -61
  4. package/LICENSE +0 -21
  5. package/dist/index.js +0 -36032
package/README.md CHANGED
@@ -1,140 +1,25 @@
1
- # RealityDB
2
-
3
- > Production-like data before production exists.
4
-
5
- RealityDB populates your PostgreSQL database with realistic, schema-aware data. Point it at your schema, pick a domain template, and get thousands of rows that look like they came from a real application. Deterministic seeds mean the same command always produces the same data.
6
-
7
- ## Quick Start
8
-
9
- ```bash
10
- npm install -g realitydb
11
-
12
- realitydb scan # Inspect your schema
13
- realitydb seed --template saas --seed 42 # Populate with realistic data
14
- realitydb reset --confirm # Clear and start fresh
15
- ```
16
-
17
- ## Domain Templates
18
-
19
- | Template | Description | Tables |
20
- |----------|-------------|--------|
21
- | `saas` | Subscription business | users, plans, subscriptions, payments |
22
- | `ecommerce` | Online store | customers, products, orders, order_items |
23
- | `education` | School system | teachers, classes, students, enrollments, grades, attendance |
24
- | `fintech` | Financial services | accounts, transactions, fraud_alerts, settlements, chargebacks |
25
- | `healthcare` | Medical system | patients, providers, encounters, diagnoses, billing |
26
-
27
- ```bash
28
- realitydb seed --template fintech --records 200 --seed 42
29
- ```
30
-
31
- Each template includes weighted distributions matching real-world data.
32
-
33
- ## Key Features
34
-
35
- ```bash
36
- # Timeline generation -- data spanning months
37
- realitydb seed --template saas --timeline 12-months --seed 42
38
-
39
- # Scenario injection -- controlled anomalies
40
- realitydb seed --template saas --scenario payment-failures --scenario-intensity high
41
-
42
- # Environment reproduction -- capture and share
43
- realitydb capture --name bug-4821
44
- realitydb load bug-4821.realitydb-pack.json --confirm
45
-
46
- # CI mode -- JSON output, proper exit codes
47
- npx realitydb seed --ci --template saas --records 500 --seed 42
48
- ```
49
-
50
- ## Data Science Mode
51
-
52
- Generate large-scale datasets for ML training, analytics testing, and data pipelines — no database required.
53
-
54
- ```bash
55
- # Generate 1M rows with default demo schema
56
- realitydb generate --records 1000000 --format csv
57
-
58
- # Generate from your SQL schema
59
- realitydb generate --schema schema.sql --records 100000 --format parquet
60
-
61
- # Generate from JSON schema with distribution controls
62
- realitydb generate --schema custom.json --records 500000 --correlations --seed 42
63
- ```
64
-
65
- ### Statistical Distributions
66
-
67
- Define per-column distributions in your JSON schema:
68
-
69
- ```json
70
- {
71
- "tables": [{
72
- "name": "users",
73
- "columns": [
74
- { "name": "age", "type": "integer", "distribution": { "type": "normal", "mean": 35, "stddev": 12, "min": 18, "max": 85 } },
75
- { "name": "income", "type": "numeric", "distribution": { "type": "log-normal", "mu": 10.5, "sigma": 0.8, "min": 15000, "max": 500000 } },
76
- { "name": "login_count", "type": "integer", "distribution": { "type": "zipf", "exponent": 1.2, "min": 1, "max": 1000 } }
77
- ]
78
- }],
79
- "correlations": [
80
- { "source": "age", "target": "income", "coefficient": 0.6 }
81
- ]
82
- }
83
- ```
84
-
85
- Supported distributions: `normal`, `uniform`, `zipf`, `exponential`, `log-normal`.
86
-
87
- ### Output Formats
88
-
89
- | Format | Flag | Description |
90
- |--------|------|-------------|
91
- | JSON | `--format json` | NDJSON (newline-delimited JSON), one object per line |
92
- | CSV | `--format csv` | Standard CSV with headers |
93
- | Parquet | `--format parquet` | NDJSON with `.parquet.ndjson` extension (convert via DuckDB/pyarrow) |
94
-
95
- ## Commands
96
-
97
- | Command | Description |
98
- |---------|-------------|
99
- | `realitydb scan` | Inspect database schema |
100
- | `realitydb seed` | Generate and insert realistic data |
101
- | `realitydb reset` | Clear seeded data |
102
- | `realitydb export` | Export data to JSON/CSV/SQL files |
103
- | `realitydb generate` | Generate large-scale datasets (no DB required) |
104
- | `realitydb capture` | Snapshot live database into a Reality Pack |
105
- | `realitydb load` | Load a Reality Pack into the database |
106
- | `realitydb share` | Display Reality Pack info for sharing |
107
- | `realitydb pack export` | Generate and export as Reality Pack |
108
- | `realitydb pack import` | Import a Reality Pack |
109
- | `realitydb templates` | List available domain templates |
110
- | `realitydb scenarios` | List available scenarios |
111
-
112
- ## Configuration
113
-
114
- Create `realitydb.config.json`:
115
-
116
- ```json
117
- {
118
- "database": {
119
- "client": "postgres",
120
- "connectionString": "postgres://user:pass@localhost:5432/mydb"
121
- },
122
- "seed": {
123
- "defaultRecords": 1000,
124
- "batchSize": 1000,
125
- "randomSeed": 42
126
- },
127
- "template": "saas"
128
- }
129
- ```
130
-
131
- ## Requirements
132
-
133
- - Node.js 20+
134
- - PostgreSQL
135
-
136
- Full documentation: [github.com/emkwambe/databox](https://github.com/emkwambe/databox)
137
-
138
- ## License
139
-
140
- MIT
1
+ # DEPRECATED
2
+
3
+ This package has been replaced by **[@realitydb/cli](https://www.npmjs.com/package/@realitydb/cli)**.
4
+
5
+ ## Install the new package
6
+ ```bash
7
+ npm install -g @realitydb/cli
8
+ ```
9
+
10
+ ## What is RealityDB?
11
+
12
+ RealityDB generates causally-correct synthetic data with:
13
+ - FK integrity (zero orphans at 2M+ rows)
14
+ - Lifecycle rules (cancelled orders have NULL shipped_at)
15
+ - Temporal ordering (shipped_at always after created_at)
16
+ - Weighted distributions (production-realistic, not uniform random)
17
+ - Seed control (--seed 42 for reproducible data)
18
+ - Direct database seeding (PostgreSQL, MySQL)
19
+
20
+ ## Links
21
+ - **CLI**: [@realitydb/cli on npm](https://www.npmjs.com/package/@realitydb/cli)
22
+ - **Sandbox**: [sandbox.realitydb.dev](https://sandbox.realitydb.dev)
23
+ - **GitHub**: [github.com/emkwambe/databox](https://github.com/emkwambe/databox)
24
+
25
+ Licensed under BSL-1.1. Copyright (c) 2026 Mpingo Systems LLC.
package/bin.js ADDED
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env node
2
+ console.error(`
3
+ ========================================================
4
+ DEPRECATED - realitydb is now @realitydb/cli
5
+
6
+ Install the new package:
7
+ npm install -g @realitydb/cli
8
+
9
+ All future updates are published to @realitydb/cli
10
+ https://www.npmjs.com/package/@realitydb/cli
11
+ ========================================================
12
+ `);
13
+ process.exit(1);
package/package.json CHANGED
@@ -1,62 +1,16 @@
1
- {
2
- "name": "realitydb",
3
- "version": "2.0.0",
4
- "description": "Developer Reality Platform - realistic database environments from your schema",
5
- "license": "MIT",
6
- "keywords": [
7
- "database",
8
- "seed",
9
- "testing",
10
- "synthetic-data",
11
- "developer-tools",
12
- "postgres",
13
- "fake-data",
14
- "test-data",
15
- "reality-engine",
16
- "schema",
17
- "realitydb"
18
- ],
19
- "repository": {
20
- "type": "git",
21
- "url": "https://github.com/emkwambe/databox.git"
22
- },
23
- "author": "Eddy Mkwambe",
24
- "homepage": "https://github.com/emkwambe/databox",
25
- "bugs": {
26
- "url": "https://github.com/emkwambe/databox/issues"
27
- },
28
- "bin": {
29
- "realitydb": "./dist/index.js"
30
- },
31
- "files": [
32
- "dist/",
33
- "README.md",
34
- "LICENSE"
35
- ],
36
- "engines": {
37
- "node": ">=20.0.0"
38
- },
39
- "scripts": {
40
- "build": "tsup",
41
- "build:tsc": "tsc",
42
- "clean": "rm -rf dist *.tsbuildinfo",
43
- "start": "node dist/index.js",
44
- "typecheck": "tsc --noEmit",
45
- "prepublishOnly": "npm run build && node dist/index.js --version"
46
- },
47
- "devDependencies": {
48
- "@databox/config": "workspace:^",
49
- "@databox/core": "workspace:^",
50
- "@databox/db": "workspace:^",
51
- "@databox/generators": "workspace:^",
52
- "@databox/schema": "workspace:^",
53
- "@databox/shared": "workspace:^",
54
- "@databox/templates": "workspace:^",
55
- "commander": "^14.0.3",
56
- "tsup": "^8.5.1",
57
- "typescript": "^5.4.0"
58
- },
59
- "dependencies": {
60
- "pg": "^8.20.0"
61
- }
1
+ {
2
+ "name": "realitydb",
3
+ "version": "2.0.14",
4
+ "description": "[DEPRECATED] Please use @realitydb/cli instead. RealityDB generates causally-correct synthetic data with FK integrity, lifecycle rules, and temporal ordering.",
5
+ "license": "BSL-1.1",
6
+ "deprecated": "This package has been replaced by @realitydb/cli. Run: npm install -g @realitydb/cli",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/emkwambe/databox"
10
+ },
11
+ "bin": {
12
+ "realitydb": "bin.js"
13
+ },
14
+ "files": ["bin.js", "README.md"],
15
+ "keywords": ["synthetic-data", "database", "testing", "faker", "seed", "postgresql", "mysql", "lifecycle", "FK-integrity"]
62
16
  }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 emkwambe
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.