@bungres/kit 0.3.0 → 0.5.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @bungres/kit
2
2
 
3
- CLI toolkit for [`@bungres/orm`](https://www.npmjs.com/package/@bungres/orm) — generate, migrate, push, pull, status, and drop your database schema with ease. 🐘✨
3
+ CLI toolkit for [`@bungres/orm`](https://www.npmjs.com/package/@bungres/orm) — initialize, generate, migrate, push, pull, status, and drop your database schema with ease. 🐘✨
4
4
 
5
5
  ## Requirements
6
6
 
@@ -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 type { BungresKitConfig } from "@bungres/kit";
23
-
24
- const config: BungresKitConfig = {
25
- // dbUrl: "postgres://...", // or set DATABASE_URL env var
26
- schema: "src/db/schema/**/*.ts",
27
- migrationsDir: "./migrations",
28
- outDir: "./src/db/generated",
29
- dbSchema: "public",
30
- verbose: false,
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: Bun.env.DATABASE_URL!,
29
+ },
30
+ });
34
31
  ```
35
32
 
36
33
  ## Commands Overview
@@ -43,21 +40,33 @@ bun run bungres --help
43
40
 
44
41
  | Command | Description |
45
42
  |---|---|
43
+ | `bungres init` | Initialize bungres project with config file and db folder structure |
46
44
  | `bungres generate` | Write a timestamped `.sql` migration file from your schema |
47
45
  | `bungres migrate` | Run pending `.sql` files, track applied in `__bungres_migrations` |
48
46
  | `bungres push` | Apply schema directly to DB — no files (great for dev/prototyping) |
49
47
  | `bungres pull` | Introspect the DB and generate TypeScript schema |
50
48
  | `bungres status` | Show applied vs pending migrations |
49
+ | `bungres fresh` | Drop all tables and re-run all migrations from scratch |
50
+ | `bungres refresh` | Truncate all tables to quickly reset data without dropping schema |
51
+ | `bungres seed` | Execute the seed script to populate the database |
52
+ | `bungres studio` | Start a local web interface to browse database data |
53
+ | `bungres tusky` | Boot up a Node REPL connected to the database with schema loaded |
51
54
  | `bungres drop` | Drop all tables defined in the schema (prompts for confirmation) |
52
55
 
53
56
  ### Usage Examples
54
57
 
55
58
  ```bash
59
+ bun run bungres init
56
60
  bun run bungres generate
57
61
  bun run bungres migrate
58
62
  bun run bungres push
59
63
  bun run bungres pull
60
64
  bun run bungres status
65
+ bun run bungres fresh
66
+ bun run bungres refresh
67
+ bun run bungres seed
68
+ bun run bungres studio
69
+ bun run bungres tusky
61
70
  bun run bungres drop --force # skip confirmation
62
71
  ```
63
72