-
-
Notifications
You must be signed in to change notification settings - Fork 18
Redis db #1444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redis db #1444
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds Redis database support to the application, enabling users to connect to and manage Redis databases through the platform. The implementation follows the existing pattern used for other database types like MongoDB, MySQL, Cassandra, etc.
- Adds Redis as a new database type to the system with appropriate enum and configuration entries
- Implements Redis-specific UI components for database credentials input and data display
- Adds field type mappings for Redis data types (string, integer, decimal, boolean, array, json) to corresponding display and edit components
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/app/models/connection.ts | Adds Redis enum value to DBtype |
| frontend/src/app/consts/table-display-types.ts | Maps Redis data types to display components |
| frontend/src/app/consts/record-view-types.ts | Maps Redis data types to record view components |
| frontend/src/app/consts/record-edit-types.ts | Maps Redis data types to edit components |
| frontend/src/app/consts/databases.ts | Registers Redis in supported databases list and titles |
| frontend/src/app/components/connect-db/db-credentials-forms/redis-credentials-form/redis-credentials-form.component.ts | Implements Redis credentials form component |
| frontend/src/app/components/connect-db/db-credentials-forms/redis-credentials-form/redis-credentials-form.component.spec.ts | Adds unit tests for Redis credentials form (contains bugs) |
| frontend/src/app/components/connect-db/db-credentials-forms/redis-credentials-form/redis-credentials-form.component.html | Provides HTML template for Redis connection form (contains MongoDB references) |
| frontend/src/app/components/connect-db/db-credentials-forms/redis-credentials-form/redis-credentials-form.component.css | Styles for Redis credentials form |
| frontend/src/app/components/connect-db/connect-db.component.ts | Integrates Redis form component and adds default port configuration |
| frontend/src/app/components/connect-db/connect-db.component.html | Adds Redis credentials form to connection UI |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1,61 @@ | |||
| import { ComponentFixture, TestBed } from '@angular/core/testing'; | |||
|
|
|||
| import { MongodbCredentialsFormComponent } from './mongodb-credentials-form.component'; | |||
Copilot
AI
Nov 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test file imports the wrong component. This should import RedisCredentialsFormComponent instead of MongodbCredentialsFormComponent.
| describe('MongodbCredentialsFormComponent', () => { | ||
| let component: MongodbCredentialsFormComponent; | ||
| let fixture: ComponentFixture<MongodbCredentialsFormComponent>; | ||
|
|
||
| beforeEach(async () => { | ||
| await TestBed.configureTestingModule({ | ||
| imports: [ | ||
| FormsModule, | ||
| MatCheckboxModule, | ||
| BrowserAnimationsModule, | ||
| Angulartics2Module.forRoot({}), | ||
| MongodbCredentialsFormComponent | ||
| ], | ||
| providers: [provideHttpClient()] | ||
| }) | ||
| .compileComponents(); | ||
|
|
||
| fixture = TestBed.createComponent(MongodbCredentialsFormComponent); | ||
| component = fixture.componentInstance; |
Copilot
AI
Nov 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test suite name and component references are incorrect. This should test RedisCredentialsFormComponent but references MongodbCredentialsFormComponent throughout. Update the describe block, component type, fixture type, and all component references to use RedisCredentialsFormComponent.
| data-testid="connection-hostname-input" | ||
| angulartics2On="change" | ||
| angularticsAction="Connection creds {{ connection.id ? 'edit' : 'add' }}: hostname is edited" | ||
| required hostnameValidator="mongodb" |
Copilot
AI
Nov 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hostnameValidator attribute should not specify "mongodb" as the value. Based on other database forms (e.g., MySQL, Cassandra), this should be either hostnameValidator without a value, or hostnameValidator="redis" if Redis requires special hostname validation.
| required hostnameValidator="mongodb" | |
| required hostnameValidator |
| [disabled]="submitting" | ||
| [(ngModel)]="connection.host"> | ||
| <mat-hint> | ||
| E.g. <strong><code>mongodb+srv://my-test-db.8a8grvb.mongoconnection.net</code></strong><br> |
Copilot
AI
Nov 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hostname example shows a MongoDB connection string instead of a Redis hostname. This should be updated to show a Redis-appropriate example, such as redis.example.com or my-redis-instance.cache.amazonaws.com.
| E.g. <strong><code>mongodb+srv://my-test-db.8a8grvb.mongoconnection.net</code></strong><br> | |
| E.g. <strong><code>redis.example.com</code></strong> or <strong><code>my-redis-instance.cache.amazonaws.com</code></strong><br> |
No description provided.