Commit 37cb9a9
Lasim
Refactor database schema and plugin system for improved flexibility and type safety
- Updated schema definitions in `schema.ts` to use column builder functions for better compatibility with different database dialects.
- Modified `PluginManager` to utilize a unified `AnyDatabase` type, allowing for both SQLite and PostgreSQL databases.
- Enhanced plugin initialization to handle cases where the database may not be set, allowing plugins to manage their own database interactions.
- Introduced new database configuration management in `config.ts`, enabling dynamic setup for SQLite and PostgreSQL.
- Created new routes for database setup and status, utilizing Zod for request validation and response schemas.
- Added migration SQL files for example plugin tables to ensure proper database structure.
- Implemented type guards and casting in example plugin to handle database-specific operations.
- Updated Fastify instance to include new database and plugin manager decorations for easier access in routes.1 parent 693df3c commit 37cb9a9
File tree
21 files changed
+1383
-305
lines changed- services/backend
- drizzle/migrations_sqlite
- src
- db
- plugin-system
- plugins/example-plugin
- routes
- db
- types
21 files changed
+1383
-305
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
| 57 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
7 | 56 | | |
8 | 57 | | |
9 | 58 | | |
| |||
117 | 166 | | |
118 | 167 | | |
119 | 168 | | |
120 | | - | |
| 169 | + | |
121 | 170 | | |
| 171 | + | |
122 | 172 | | |
123 | 173 | | |
124 | 174 | | |
125 | 175 | | |
126 | 176 | | |
127 | 177 | | |
128 | 178 | | |
129 | | - | |
| 179 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
82 | 96 | | |
83 | 97 | | |
84 | 98 | | |
| |||
0 commit comments