create-mantiq 0.5.14 → 0.5.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-mantiq",
3
- "version": "0.5.14",
3
+ "version": "0.5.15",
4
4
  "description": "Scaffold a new MantiqJS application",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -0,0 +1,17 @@
1
+ import { ServiceProvider, config } from '@mantiq/core'
2
+ import { DatabaseManager, setupModels, setManager } from '@mantiq/database'
3
+
4
+ export class DatabaseServiceProvider extends ServiceProvider {
5
+ override register(): void {
6
+ this.app.singleton(DatabaseManager, () => {
7
+ const manager = new DatabaseManager(config('database'))
8
+ setManager(manager)
9
+ setupModels(manager)
10
+ return manager
11
+ })
12
+ }
13
+
14
+ override async boot(): Promise<void> {
15
+ this.app.make(DatabaseManager)
16
+ }
17
+ }