Conversation
- Added protection for secrets, credentials, and keys - Included patterns for environment files - Added coverage for IDE files, OS files, and build artifacts - Security-first approach to prevent accidental credential commits
- Removed azure-pipelines.yml (migrating to GitHub Actions) - All CI/CD now handled via GitHub Actions workflows
- Added ci.yml for PR/push validation (lint, test, build) - Updated publish.yml with npm provenance support - Multi-node version testing (18, 20, 22) - Artifact upload for build outputs
- Added comprehensive copilot-instructions.md - Includes architecture overview, naming conventions - Code patterns, anti-patterns, testing requirements - Security practices and release checklist
- Deleted src/core/adapters/mongo.adapter.ts - Deleted src/core/adapters/postgres.adapter.ts - Deleted src/core/contracts.ts - Deleted src/core/database.ts - Deleted src/nest/database.decorators.ts - Deleted src/nest/database.module.ts BREAKING CHANGE: Complete restructure to new architecture
- Added database.contracts.ts with all interfaces and types - DatabaseConfig discriminated union (mongo | postgres) - Repository<T> interface for unified CRUD operations - PageResult and PageOptions for pagination - Module configuration types
- Added mongo.adapter.ts with Mongoose integration - Added postgres.adapter.ts with Knex integration - Both implement Repository<T> interface - Connection pooling and lifecycle management - Pagination support built-in
- Added database.service.ts as main facade service - Added logger.service.ts for consistent logging - DatabaseService manages adapters and repositories - Implements NestJS OnModuleDestroy lifecycle hook
- Added database.constants.ts with DI tokens - Added database.config.ts with config helpers - Environment-driven configuration support - DATABASE_TOKEN and DATABASE_OPTIONS_TOKEN for DI
- Added database.decorators.ts with @InjectDatabase() - Added database-exception.filter.ts for error handling - Global exception filter for database errors - Custom DI decorator for clean injection
- Added pagination.utils.ts with pagination helpers - Added validation.utils.ts with validation helpers - Added comprehensive unit tests for utilities - isValidMongoId, isValidUuid, sanitizeFilter, etc.
- NestJS DynamicModule with forRoot() and forRootAsync() - forFeature() for feature module registration - Auto-connect option with graceful shutdown - Proper provider configuration and exports
- Clean barrel exports in index.ts - Exports only public API surface - Internal implementations kept private - Comprehensive type exports for consumers
- Upgraded to latest dependencies (ESLint 9, TS 5.8) - Updated tsconfig.json with path aliases - Added proper scripts for build, test, lint - Updated package.json metadata and peer deps
- Added eslint.config.mjs (ESLint 9 flat config) - Added jest.config.js for testing - Added .env.example with sample environment vars
- Updated README.md with new architecture - Updated CHANGELOG.md with v1.0.0 changes - Updated SECURITY.md with security policy - Updated CONTRIBUTING.md with contribution guide - Added TROUBLESHOOTING.md for common issues
- Add TransactionOptions, TransactionContext, MongoTransactionContext, PostgresTransactionContext types to contracts - Implement withTransaction() in MongoAdapter using Mongoose sessions - Implement withTransaction() in PostgresAdapter using Knex transactions - Support transaction isolation levels for PostgreSQL - Add retry logic with exponential backoff for transient failures - Expose withTransaction(), withMongoTransaction(), withPostgresTransaction() methods in DatabaseService - Add comprehensive tests for transaction functionality - Export all transaction types from public API Tests: 74 passed
- Add insertMany, updateMany, deleteMany methods to Repository interface - Implement bulk operations in MongoAdapter with session/transaction support - Implement bulk operations in PostgresAdapter with Knex support - Add comprehensive tests for all bulk operations - Both adapters support empty array handling for insertMany Repository interface now supports: - insertMany(data[]) -> T[] - Create multiple entities - updateMany(filter, update) -> number - Update matching entities - deleteMany(filter) -> number - Delete matching entities Tests: 82 passed
- Add HealthCheckResult interface with healthy, responseTimeMs, type, error, details - Implement healthCheck() in MongoAdapter using admin.ping() command - Implement healthCheck() in PostgresAdapter using SELECT version() query - Expose healthCheck() method in DatabaseService facade - Include pool status and database version in health check details - Export HealthCheckResult type from public API - Add comprehensive tests for health check functionality Useful for: - Load balancer health endpoints - Kubernetes liveness/readiness probes - Application monitoring dashboards Tests: 92 passed
- Add softDelete and softDeleteField options to MongoRepositoryOptions - Add softDelete and softDeleteField options to PostgresEntityConfig - Implement soft delete in MongoAdapter: - All query methods filter out deleted records by default - deleteById/deleteMany set deletedAt instead of hard delete - softDelete(), softDeleteMany() for explicit soft delete - restore(), restoreMany() to recover soft-deleted records - findDeleted() and findAllWithDeleted() for querying deleted records - Implement soft delete in PostgresAdapter: - Same functionality with deleted_at as default field - Respects column whitelisting for security - Add 17 new tests for soft delete functionality - Total tests: 109 passing
- Add timestamps, createdAtField, updatedAtField to MongoRepositoryOptions - Add timestamps, createdAtField, updatedAtField to PostgresEntityConfig - Implement timestamp injection in MongoAdapter: - create() and insertMany() set createdAt automatically - updateById() and updateMany() set updatedAt automatically - Default field: 'createdAt', 'updatedAt' for MongoDB - Implement timestamp injection in PostgresAdapter: - Same behavior with 'created_at', 'updated_at' defaults - Respects custom field name configuration - Works seamlessly with soft delete feature - Add 11 new tests for timestamp functionality - Total tests: 120 passing
- Add findOne() method for single record lookup by filter - Add upsert() for update-or-insert operations - Add distinct() for unique field values - Add select() for field projection - Add PoolConfig interface for connection pool tuning - Add RepositoryHooks system (beforeCreate, afterCreate, beforeUpdate, afterUpdate, beforeDelete, afterDelete) - Implement hooks in both MongoDB and PostgreSQL adapters - Add comprehensive tests for all new features (133 total tests) - Update CHANGELOG for v1.0.0 release
- general.instructions.md: Main guidelines, architecture, patterns - adapters.instructions.md: Database adapter implementation guide - testing.instructions.md: Testing patterns and requirements - features.instructions.md: Feature implementation workflow - bugfix.instructions.md: Bug investigation and fix process All files updated to February 2026
There was a problem hiding this comment.
Pull request overview
This pull request represents a comprehensive production-ready release (v1.0.0) of DatabaseKit, transforming it from a basic database library into a fully-featured NestJS module following CISCODE patterns. The changes include major architectural improvements, extensive documentation, advanced features (transactions, bulk operations, soft delete, hooks), and complete GitHub Actions CI/CD setup.
Changes:
- Complete architectural refactoring following clean architecture patterns with proper layer separation
- Added advanced features: transactions, bulk operations, soft delete, timestamps, lifecycle hooks, connection pooling, and health checks
- Comprehensive documentation suite including README, CONTRIBUTING, SECURITY, TROUBLESHOOTING, and GitHub Copilot instructions
- Full CI/CD setup with GitHub Actions workflows and ESLint 9 flat config
Reviewed changes
Copilot reviewed 16 out of 6491 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| eslint.config.mjs | New ESLint 9 flat config with TypeScript support and custom rules |
| azure-pipelines.yml | Removed Azure DevOps pipeline (replaced with GitHub Actions) |
| TROUBLESHOOTING.md | New comprehensive troubleshooting guide for common issues |
| SECURITY.md | Expanded security documentation with best practices and vulnerability reporting |
| README.md | Complete rewrite with extensive API documentation and examples |
| CONTRIBUTING.md | Expanded contribution guide with detailed development workflow |
| CODE_OF_CONDUCT | Updated contact email to info@ciscod.com |
| CHANGELOG.md | Detailed v1.0.0 release notes with all features and migration guide |
| .github/workflows/publish.yml | Updated npm publish workflow with modern Node.js and security features |
| .github/workflows/ci.yml | New CI workflow for automated testing across Node versions |
| .github/instructions/*.md | New GitHub Copilot instruction files for AI-assisted development |
| .env.example | New environment variables template |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.