realitydb 2.0.1 → 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.
- package/README.md +25 -140
- package/bin.js +13 -0
- package/package.json +15 -61
- package/LICENSE +0 -80
- package/dist/index.js +0 -36312
package/README.md
CHANGED
|
@@ -1,140 +1,25 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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.
|
|
4
|
-
"description": "
|
|
5
|
-
"license": "
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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,80 +0,0 @@
|
|
|
1
|
-
Business Source License 1.1
|
|
2
|
-
|
|
3
|
-
Parameters
|
|
4
|
-
|
|
5
|
-
Licensor: Mpingo Systems Ltd (Eddy Mkwambe)
|
|
6
|
-
Licensed Work: RealityDB Sandbox
|
|
7
|
-
The Licensed Work is (c) 2026 Mpingo Systems Ltd
|
|
8
|
-
Additional Use Grant: You may make use of the Licensed Work, provided that
|
|
9
|
-
you do not use the Licensed Work for a Synthetic Data
|
|
10
|
-
Service, SQL Learning Service, or Database Simulation
|
|
11
|
-
Service.
|
|
12
|
-
|
|
13
|
-
A "Synthetic Data Service" is a commercial offering
|
|
14
|
-
that allows third parties to access the functionality
|
|
15
|
-
of the Licensed Work by generating synthetic database
|
|
16
|
-
records, test data, or simulation environments.
|
|
17
|
-
|
|
18
|
-
A "SQL Learning Service" is a commercial offering that
|
|
19
|
-
allows third parties to practice SQL queries against
|
|
20
|
-
auto-graded challenges using functionality substantially
|
|
21
|
-
derived from the Licensed Work.
|
|
22
|
-
|
|
23
|
-
A "Database Simulation Service" is a commercial offering
|
|
24
|
-
that allows third parties to create or access simulated
|
|
25
|
-
database environments with lifecycle-coherent data using
|
|
26
|
-
functionality substantially derived from the Licensed Work.
|
|
27
|
-
|
|
28
|
-
You may use the Licensed Work for internal testing,
|
|
29
|
-
development, education, research, and any non-competing
|
|
30
|
-
commercial purpose without restriction.
|
|
31
|
-
|
|
32
|
-
Change Date: March 31, 2030
|
|
33
|
-
Change License: Apache License, Version 2.0
|
|
34
|
-
|
|
35
|
-
For information about alternative licensing arrangements for the Licensed Work,
|
|
36
|
-
please contact: licensing@realitydb.dev
|
|
37
|
-
|
|
38
|
-
Notice
|
|
39
|
-
|
|
40
|
-
Business Source License 1.1 (the "License")
|
|
41
|
-
|
|
42
|
-
The Licensor hereby grants you the right to copy, modify, create derivative
|
|
43
|
-
works, redistribute, and make non-production use of the Licensed Work. The
|
|
44
|
-
Licensor may make an Additional Use Grant, above, permitting limited production
|
|
45
|
-
use.
|
|
46
|
-
|
|
47
|
-
Effective on the Change Date, or the fourth anniversary of the first publicly
|
|
48
|
-
available distribution of a specific version of the Licensed Work under this
|
|
49
|
-
License, whichever comes first, the Licensor hereby grants you rights under
|
|
50
|
-
the terms of the Change License, and the rights granted in the paragraph
|
|
51
|
-
above terminate.
|
|
52
|
-
|
|
53
|
-
If your use of the Licensed Work does not comply with the requirements
|
|
54
|
-
currently in effect as described in this License, you must purchase a
|
|
55
|
-
commercial license from the Licensor, its affiliated entities, or authorized
|
|
56
|
-
resellers, or you must refrain from using the Licensed Work.
|
|
57
|
-
|
|
58
|
-
All copies of the original and modified Licensed Work, and derivative works
|
|
59
|
-
of the Licensed Work, are subject to this License. This License applies
|
|
60
|
-
separately for each version of the Licensed Work and the Change Date may vary
|
|
61
|
-
for each version of the Licensed Work released by Licensor.
|
|
62
|
-
|
|
63
|
-
You must conspicuously display this License on each original or modified copy
|
|
64
|
-
of the Licensed Work. If you receive the Licensed Work in original or
|
|
65
|
-
modified form from a third party, the terms and conditions set forth in this
|
|
66
|
-
License apply to your use of that work.
|
|
67
|
-
|
|
68
|
-
Any use of the Licensed Work in violation of this License will automatically
|
|
69
|
-
terminate your rights under this License for the current and all other
|
|
70
|
-
versions of the Licensed Work.
|
|
71
|
-
|
|
72
|
-
This License does not grant you any right in any trademark or logo of
|
|
73
|
-
Licensor or its affiliates (provided that you may use a trademark or logo of
|
|
74
|
-
Licensor as expressly required by this License).
|
|
75
|
-
|
|
76
|
-
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
|
|
77
|
-
AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
|
|
78
|
-
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
|
|
79
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
|
|
80
|
-
TITLE.
|