A database module for NestJS applications, built on top of TypeORM.
npm install @nestjs-db-module/core
## Configuration
The `register` method accepts a `DatabaseConfig` object with the following properties:
- `type`: Database type (e.g., 'postgres', 'mysql', 'sqlite')
- `host`: Database host
- `port`: Database port
- `username`: Database username
- `password`: Database password
- `database`: Database name
- `entities`: Array of entity classes
- `synchronize`: Boolean to enable/disable schema synchronization (use with caution in production)
### Entity Registration
Use the `forEntity` method to register entities for a specific database:
```typescript
const entities = [User, Product];
const module = DatabaseModule.forEntity(config, entities);
Registers the database connection with the given configuration.
Registers the specified entities for the given database configuration.
This project is licensed under the MIT License - see the LICENSE file for details.