@bungres/kit 0.3.0 → 0.4.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 +19 -12
- package/dist/cli.js +1450 -589
- package/dist/commands/drop.d.ts.map +1 -1
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/studio.d.ts.map +1 -1
- package/dist/index.js +556 -152
- package/package.json +19 -3
- package/src/cli.ts +0 -162
- package/src/commands/drop.ts +0 -92
- package/src/commands/fresh.ts +0 -17
- package/src/commands/generate.ts +0 -151
- package/src/commands/migrate.ts +0 -84
- package/src/commands/pull.ts +0 -339
- package/src/commands/push.ts +0 -105
- package/src/commands/refresh.ts +0 -37
- package/src/commands/seed.ts +0 -41
- package/src/commands/status.ts +0 -64
- package/src/commands/studio.ts +0 -471
- package/src/commands/tusky.ts +0 -83
- package/src/config.ts +0 -102
- package/src/differ.ts +0 -236
- package/src/ensure-db.ts +0 -32
- package/src/index.ts +0 -21
- package/src/schema-loader.ts +0 -50
- package/src/utils/colors.ts +0 -4
package/README.md
CHANGED
|
@@ -19,18 +19,15 @@ bun add -d @bungres/kit
|
|
|
19
19
|
Create a `bungres.config.ts` file at the root of your project:
|
|
20
20
|
|
|
21
21
|
```ts
|
|
22
|
-
import
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export default config;
|
|
22
|
+
import { defineConfig } from "@bungres/kit";
|
|
23
|
+
|
|
24
|
+
export default defineConfig({
|
|
25
|
+
schema: "./src/db/schema.ts",
|
|
26
|
+
out: "./bungres", // Directory for migrations & generated files
|
|
27
|
+
dbCredentials: {
|
|
28
|
+
url: process.env.DATABASE_URL!,
|
|
29
|
+
},
|
|
30
|
+
});
|
|
34
31
|
```
|
|
35
32
|
|
|
36
33
|
## Commands Overview
|
|
@@ -48,6 +45,11 @@ bun run bungres --help
|
|
|
48
45
|
| `bungres push` | Apply schema directly to DB — no files (great for dev/prototyping) |
|
|
49
46
|
| `bungres pull` | Introspect the DB and generate TypeScript schema |
|
|
50
47
|
| `bungres status` | Show applied vs pending migrations |
|
|
48
|
+
| `bungres fresh` | Drop all tables and re-run all migrations from scratch |
|
|
49
|
+
| `bungres refresh` | Truncate all tables to quickly reset data without dropping schema |
|
|
50
|
+
| `bungres seed` | Execute the seed script to populate the database |
|
|
51
|
+
| `bungres studio` | Start a local web interface to browse database data |
|
|
52
|
+
| `bungres tusky` | Boot up a Node REPL connected to the database with schema loaded |
|
|
51
53
|
| `bungres drop` | Drop all tables defined in the schema (prompts for confirmation) |
|
|
52
54
|
|
|
53
55
|
### Usage Examples
|
|
@@ -58,6 +60,11 @@ bun run bungres migrate
|
|
|
58
60
|
bun run bungres push
|
|
59
61
|
bun run bungres pull
|
|
60
62
|
bun run bungres status
|
|
63
|
+
bun run bungres fresh
|
|
64
|
+
bun run bungres refresh
|
|
65
|
+
bun run bungres seed
|
|
66
|
+
bun run bungres studio
|
|
67
|
+
bun run bungres tusky
|
|
61
68
|
bun run bungres drop --force # skip confirmation
|
|
62
69
|
```
|
|
63
70
|
|