@lunora/seed 1.0.0-alpha.101 → 1.0.0-alpha.102
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 +3 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
|
|
37
37
|
`@lunora/seed` populates a Lunora database with realistic, production-like fake data derived from your `defineSchema`. It introspects every table, maps each field to a generator (field-name aware — a `string` column called `email` becomes an email address, `firstName` a first name, and so on), resolves foreign keys by inserting parent tables before their children, and lets you override any value.
|
|
38
38
|
|
|
39
|
-
Generation is **deterministic**: it is built on a vendored, input-hashed generator (a rebuilt [`copycat`](https://github.com/supabase-community/copycat)) layered over [`@faker-js/faker`](https://fakerjs.dev).
|
|
39
|
+
Generation is **deterministic**: it is built on a vendored, input-hashed generator (a rebuilt [`copycat`](https://github.com/supabase-community/copycat)) layered over [`@faker-js/faker`](https://fakerjs.dev). Generation is deterministic in `seed` alone for every column except the time-valued ones: a `number` column named like a timestamp (`createdAt`, `expiresAt`, …) is generated relative to the wall clock, so two runs with the same `seed` differ unless you also pin `now` (`--now` on the CLI). Ids are unaffected. Pin the `(seed, now)` pair and a plan is byte-identical across runs and machines.
|
|
40
40
|
|
|
41
41
|
Part of the [Lunora](https://github.com/anolilab/lunora) framework — a type-safe, real-time backend on Cloudflare Workers + Durable Objects with a Vite-first DX.
|
|
42
42
|
|
|
@@ -121,7 +121,7 @@ Supply a `persist` hook (`SeedClientOptions.persist`) to write each batch as it
|
|
|
121
121
|
```bash
|
|
122
122
|
lunora seed --count 25 # 25 rows per table (default 10)
|
|
123
123
|
lunora seed --table posts --count 100 # one table (FK parents seeded automatically)
|
|
124
|
-
lunora seed --seed 42
|
|
124
|
+
lunora seed --seed 42 --now 1750000000000 # byte-identical run (pin both)
|
|
125
125
|
lunora seed --reset # wipe local .wrangler/state first (local dev only)
|
|
126
126
|
lunora seed --dry-run # print NDJSON, write nothing
|
|
127
127
|
```
|
|
@@ -130,7 +130,7 @@ Also: `--batch-size` (rows per HTTP request, default 500), `--url` (worker URL,
|
|
|
130
130
|
|
|
131
131
|
## Limitations
|
|
132
132
|
|
|
133
|
-
- **`.unique()` columns are
|
|
133
|
+
- **`.unique()` columns are dealt distinct values by construction.** Each value is a function of the row's absolute index, not a hash of the row, so two rows in the same run never collide — including across the several calls `indexOffset` exists to support. A column whose domain is too small to cover the requested count (a boolean, a three-literal `v.union()`) is refused at plan time, with the column named, before anything is inserted.
|
|
134
134
|
- **Seeding is deterministic by design.** Re-running with the same `--seed` regenerates identical `_id`s, which the import path skips as conflicts. Use a different `--seed` for fresh rows, or `--reset` to wipe local state first.
|
|
135
135
|
|
|
136
136
|
> This README covers the basics. For the full API, options, and guides, see the **[documentation](https://lunora.sh/docs/packages/seed)**.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/seed",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.102",
|
|
4
4
|
"description": "Schema-driven, deterministic database seeding for Lunora: realistic fake data from defineSchema",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@faker-js/faker": "^10.5.0",
|
|
51
|
-
"@lunora/errors": "1.0.0-alpha.
|
|
51
|
+
"@lunora/errors": "1.0.0-alpha.30"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"@lunora/server": ">=1.0.0-alpha.24 <2.0.0-0",
|