Commit 98d6aab
committed
feat: Add database connection pool with automatic database creation and initialization
- Implemented `Client` class to manage database connections and initialization.
- Integrated `ConnectionPool` class to handle database connection pooling using `pg` library.
- Added error handling for failed database connections using custom `Catch` decorator.
- Added functionality to automatically create the database if it doesn't exist.
- Implemented `initialize` method in `Client` to connect, initialize, and seed database tables.
- Encapsulated database connection logic in `ConnectionPool` with methods for connecting, creating a database, and retrieving a client.
This feature provides an organized approach to managing database connections and ensures that the database is properly initialized and seeded on first use.1 parent 92f2ae2 commit 98d6aab
2 files changed
Lines changed: 21 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
0 commit comments