Skip to content

Commit 0dbaed9

Browse files
resolve with mysql info object
1 parent 0e5141f commit 0dbaed9

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

src/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ async function main() {
3939
}
4040
console.log('Creating ephemeral MySQL database...')
4141
const db = await createDB(options);
42-
console.log(`A MySQL database has been successfully created with the following parameters:\n\nMySQL Version: ${db.version} \nUsername: ${db.username} \nDatabase Name: ${db.dbName} \nPort: ${db.port} \nX Plugin Port: ${db.xPort} \nSocket: ${db.socket} \nX Plugin Socket: ${db.xSocket}\n`)
42+
console.log(`A MySQL database has been successfully created with the following parameters:\n\nMySQL Version: ${db.mysql.version} \nUsername: ${db.username} \nDatabase Name: ${db.dbName} \nPort: ${db.port} \nX Plugin Port: ${db.xPort} \nSocket: ${db.socket} \nX Plugin Socket: ${db.xSocket}\n`)
4343
if (process.platform === 'win32') {
4444
//The connection information logs will be different for Windows compared to other platforms.
4545
//Windows uses mysqlsh instead of mysql to invoke the client shell, needs a --sql flag to be put into SQL mode, and also does not have a protocol flag.

src/libraries/Executor.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class Executor {
1616
DBDestroySignal = new AbortController();
1717
removeExitHandler: () => void;
1818
version: string;
19+
versionInstalledOnSystem: boolean;
1920

2021
constructor(logger: Logger) {
2122
this.logger = logger;
@@ -191,7 +192,10 @@ class Executor {
191192
xSocket,
192193
dbName: options.dbName,
193194
username: options.username,
194-
version: this.version,
195+
mysql: {
196+
version: this.version,
197+
versionIsInstalledOnSystem: this.versionInstalledOnSystem
198+
},
195199
stop: () => {
196200
return new Promise(async (resolve, reject) => {
197201
resolveFunction = resolve;
@@ -424,6 +428,7 @@ class Executor {
424428

425429
async startMySQL(options: InternalServerOptions, installedMySQLBinary: DownloadedMySQLVersion): Promise<MySQLDB> {
426430
this.version = installedMySQLBinary.version
431+
this.versionInstalledOnSystem = installedMySQLBinary.installedOnSystem
427432
this.removeExitHandler = onExit(() => {
428433
if (options._DO_NOT_USE_cli) {
429434
console.log('\nShutting down the ephemeral MySQL database and cleaning all related files...')

types/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,10 @@ export type MySQLDB = {
6161
xSocket: string,
6262
dbName: string,
6363
username: string,
64-
version: string,
64+
mysql: {
65+
version: string,
66+
versionIsInstalledOnSystem: boolean
67+
},
6568
stop: () => Promise<void>
6669
}
6770

0 commit comments

Comments
 (0)