@h3ravel/arquebus 0.4.1 → 0.6.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.
Files changed (45) hide show
  1. package/README.md +20 -1
  2. package/bin/index.cjs +225 -171
  3. package/bin/index.js +208 -122
  4. package/bin/seeders-8GJzfIIN.js +3 -0
  5. package/bin/seeders-ByeSoCAQ.cjs +131 -0
  6. package/bin/seeders-CltigymO.js +79 -0
  7. package/bin/seeders-_xJ6VGVS.cjs +3 -0
  8. package/dist/browser/index.cjs +9 -9
  9. package/dist/browser/index.d.cts +3655 -183
  10. package/dist/browser/index.d.ts +3655 -183
  11. package/dist/browser/index.js +9 -9
  12. package/dist/index.cjs +270 -135
  13. package/dist/index.d.cts +3797 -294
  14. package/dist/index.d.ts +3797 -294
  15. package/dist/index.js +263 -133
  16. package/dist/inspector/index.cjs +122 -46
  17. package/dist/inspector/index.js +119 -46
  18. package/dist/migrations/index.cjs +171 -151
  19. package/dist/migrations/index.d.cts +3510 -27
  20. package/dist/migrations/index.d.ts +3510 -27
  21. package/dist/migrations/index.js +177 -150
  22. package/dist/migrations/stubs/migration-js.stub +1 -1
  23. package/dist/migrations/stubs/migration-ts.stub +1 -1
  24. package/dist/migrations/stubs/migration.create-js.stub +5 -5
  25. package/dist/migrations/stubs/migration.create-ts.stub +5 -5
  26. package/dist/migrations/stubs/migration.update-js.stub +2 -2
  27. package/dist/migrations/stubs/migration.update-ts.stub +3 -3
  28. package/dist/seeders/index.cjs +141 -0
  29. package/dist/seeders/index.d.cts +4766 -0
  30. package/dist/seeders/index.d.ts +4766 -0
  31. package/dist/seeders/index.js +118 -0
  32. package/dist/seeders/index.ts +3 -0
  33. package/dist/seeders/runner.ts +102 -0
  34. package/dist/seeders/seeder-creator.ts +42 -0
  35. package/dist/seeders/seeder.ts +10 -0
  36. package/dist/stubs/seeder-js.stub +13 -0
  37. package/dist/stubs/seeder-ts.stub +9 -0
  38. package/package.json +15 -4
  39. package/types/builder.ts +158 -80
  40. package/types/container.ts +79 -66
  41. package/types/generics.ts +75 -36
  42. package/types/modeling.ts +213 -158
  43. package/types/query-builder.ts +223 -186
  44. package/types/query-methods.ts +160 -104
  45. package/types/utils.ts +64 -55
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  [![Framework][ix]][lx]
8
8
  [![Arquebus ORM][i1]][l1]
9
- [![Downloads][d1]][d1]
9
+ [![Downloads][d1]][l1]
10
10
  [![Tests][tei]][tel]
11
11
  [![License][lini]][linl]
12
12
 
@@ -94,6 +94,25 @@ const users = await User.query()
94
94
  await user.load('posts');
95
95
  ```
96
96
 
97
+ ## Seeders
98
+
99
+ - Create a seeder: `npx arquebus make:seeder UsersSeeder`
100
+ - Run seeders: `npx arquebus db:seed` or `npx arquebus db:seed --path ./database/seeders`
101
+ - Seeder class example (TypeScript):
102
+
103
+ ```ts
104
+ import { Seeder } from '@h3ravel/arquebus';
105
+ import type QueryBuilder from '@h3ravel/arquebus/types/query-builder';
106
+
107
+ export default class UsersSeeder extends Seeder {
108
+ async run(connection: QueryBuilder) {
109
+ await connection.table('users').insert({ name: 'Alice' });
110
+ }
111
+ }
112
+ ```
113
+
114
+ Seeders execute with the same connection setup as migrations. The CLI resolves paths from `--basePath` and `--path` and loads seeders from `.ts`/`.js` files exporting a default class with a `run` method.
115
+
97
116
  ## Show Your Support
98
117
 
99
118
  Please ⭐️ this repository if this project helped you