Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions cli/src/commands/wheels/base.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -997,6 +997,8 @@ component extends="wheels-cli.models.BaseCommand" excludeFromHelp=true {
// Connect to information_schema for MySQL system operations
return "jdbc:mysql://#local.host#:#local.port#/information_schema";
case "PostgreSQL":
case "Postgres":
case "Postgre":
if (!Len(local.port)) local.port = "5432";
// Connect to postgres system database
return "jdbc:postgresql://#local.host#:#local.port#/postgres";
Expand Down Expand Up @@ -1341,7 +1343,7 @@ component extends="wheels-cli.models.BaseCommand" excludeFromHelp=true {
local.username = local.dbConfig.tempDS.username ?: "";
local.password = local.dbConfig.tempDS.password ?: "";

printStep("Connecting to " & arguments.dbType & " database...");
detailOutput.output("Connecting to " & arguments.dbType & " database...");

// Try to load driver
local.driver = "";
Expand All @@ -1352,7 +1354,7 @@ component extends="wheels-cli.models.BaseCommand" excludeFromHelp=true {
local.driver = createObject("java", local.driverClass);
local.result.driverClass = local.driverClass;
local.driverFound = true;
printSuccess("Driver found: " & local.driverClass);
detailOutput.statusSuccess("Driver found: " & local.driverClass);
break;
} catch (any driverError) {
// Continue trying other drivers
Expand All @@ -1376,8 +1378,6 @@ component extends="wheels-cli.models.BaseCommand" excludeFromHelp=true {
}

// Connect using driver directly
print.line(local.url);
print.redLine(local.props);
local.conn = local.driver.connect(local.url, local.props);

if (isNull(local.conn)) {
Expand All @@ -1387,7 +1387,7 @@ component extends="wheels-cli.models.BaseCommand" excludeFromHelp=true {

local.result.success = true;
local.result.connection = local.conn;
printSuccess("Connected successfully to " & arguments.dbType & " database!");
detailOutput.statusSuccess("Connected successfully to " & arguments.dbType & " database!");
return local.result;

} catch (any e) {
Expand Down
10 changes: 9 additions & 1 deletion cli/src/commands/wheels/db/create.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ component extends="../base" {
case "MySQL5":
createDatabase(local.dsInfo, local.dbName, arguments.force, "MySQL");
break;
case "Postgre":
case "Postgres":
case "PostgreSQL":
createDatabase(local.dsInfo, local.dbName, arguments.force, "PostgreSQL");
break;
Expand Down Expand Up @@ -246,7 +248,7 @@ component extends="../base" {

// Test if driver accepts the URL
if (!local.driver.acceptsURL(local.url)) {
detailOutput.error(arguments.dbType & " driver does not accept the URL format");
detailOutput.error(arguments.dbType & " driver does not accept the URL format: #local.url#");
return;
}

Expand Down Expand Up @@ -579,6 +581,8 @@ component extends="../base" {
local.templateKey = "mysql";
break;
case "PostgreSQL":
case "Postgre":
case "Postgres":
local.templateKey = "postgre";
break;
case "MSSQLServer":
Expand Down Expand Up @@ -874,6 +878,8 @@ component extends="../base" {
case "MySQL":
return "jdbc:mysql://#arguments.host#:#arguments.port#/#arguments.database#?characterEncoding=UTF-8&serverTimezone=UTC&maxReconnects=3";
case "PostgreSQL":
case "Postgre":
case "Postgres":
return "jdbc:postgresql://#arguments.host#:#arguments.port#/#arguments.database#";
case "MSSQLServer":
return "jdbc:sqlserver://#arguments.host#:#arguments.port#;DATABASENAME=#arguments.database#;trustServerCertificate=true;SelectMethod=direct";
Expand Down Expand Up @@ -1241,6 +1247,8 @@ component extends="../base" {
case "MySQL":
case "MySQL5":
return "mysql";
case "Postgre":
case "Postgres":
case "PostgreSQL":
return "postgres";
case "MSSQLServer":
Expand Down
Loading
Loading