Groovy web console

subscribe to the feed Subscribe
to this
site

test

Published 2 weeks ago by t with tags t
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def resolveDatabaseType(databaseEngine) {    
    switch(databaseEngine){
        case ~/aws-rds-aurora-postgres|aws-rds-postgres/:
            DATABASE_TYPE = "postgres"
            break
        case "aws-rds-oracle":
            DATABASE_TYPE = "oracle"
            break
    }
    return "${DATABASE_TYPE}"
}

println(resolveDatabaseType("aws-rds-aurora-postgres"))
println(resolveDatabaseType("aws-rds-postgres"))
println(resolveDatabaseType("aws-rds-oracle"))