Skip to content

Commit

Permalink
$$$ update $$$
Browse files Browse the repository at this point in the history
  • Loading branch information
darekf77 committed Apr 29, 2024
1 parent 2c59a64 commit fdab9eb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/lib/endpoint-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,18 @@ export class EndpointContext {
if (config.database === true) {
if (Helpers.isRunningInDocker()) {
Helpers.info('Running in docker, using in mysql database');
// TODO
// TODO auto resolve database config in docker
this.databaseConfig = {
database: `firedev-db-${EndpointContext.endpointId++}.sqljs.db`,
type: 'mysql',
autoSave: true,
synchronize: true,
dropSchema: true,
logging: true,
databasePort: 3306,
databaseHost: 'localhost',
databaseUsername: "root",
databasePassword: "admin",
}
} else {
Helpers.info(`Automatically resolving database config for mode ${this.mode}`);
Expand Down Expand Up @@ -667,6 +671,8 @@ export class EndpointContext {
type: config.type,
port: config.databasePort,
host: config.databaseHost,
username: config.databaseUsername,
password: config.databasePassword,
entities: this.getClassFunByArr(Models.ClassType.ENTITY),
synchronize: config.synchronize,
autoSave: config.autoSave,
Expand Down
2 changes: 2 additions & 0 deletions src/lib/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ export namespace Models {
type?: CoreModels.DatabaseType;
databasePort?: number;
databaseHost?: string;
databaseUsername?: string,
databasePassword?: string,
}
//#endregion

Expand Down

0 comments on commit fdab9eb

Please sign in to comment.