You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//Try to convert the options to their correct types.
20
+
//We do not need to do any proper type validation here as the library will make sure everything is correct.
21
+
//Like for example, if a string is passed to a number option, it'll be converted to NaN here, but the library
22
+
//will throw an error for it not being an actual number.
23
+
if(optionType==='boolean'){
24
+
if(optionValue==='true'){
25
+
options[optionName]=true
26
+
}elseif(optionValue==='false'){
27
+
options[optionName]=false
28
+
}else{
29
+
options[optionName]=optionValue
30
+
}
31
+
}elseif(optionType==='number'){
32
+
options[optionName]=parseInt(optionValue)
33
+
}else{
34
+
options[opt.slice(2)]=optionValue
35
+
}
36
+
}
5
37
console.log('Creating ephemeral MySQL database...')
6
-
constdb=awaitcreateDB();
7
-
console.log(`A MySQL databases has been successfully created with the following parameters.\n\nUsername: ${db.username} \nDatabase Name: ${db.dbName} \nPort: ${db.port} \nX Plugin Port: ${db.xPort} \nSocket: ${db.socket} \nX Plugin Socket: ${db.xSocket}\n`)
38
+
constdb=awaitcreateDB(options);
39
+
console.log(`A MySQL databases has been successfully created with the following parameters:\n\nUsername: ${db.username} \nDatabase Name: ${db.dbName} \nPort: ${db.port} \nX Plugin Port: ${db.xPort} \nSocket: ${db.socket} \nX Plugin Socket: ${db.xSocket}\n`)
8
40
console.log(`If you want to use the MySQL CLI client to connect to the database, you can use either commands: \nmysql -u ${db.username} -P ${db.port} --protocol tcp \nOR\nmysql -u ${db.username} --socket ${db.socket}`)
0 commit comments