grails / grails-forge

This is Grails project creator. Grails projects may be created using the browser interface, Command Line, or via CURL.
Apache License 2.0
3 stars 9 forks source link

Grails Forge: in application.yml add environment specific database configuration #373

Closed fernando88to closed 1 week ago

fernando88to commented 1 year ago

Expected Behavior

That the application.yml file came with the settings below

dataSource:
    pooled: true
    jmxExport: true
    driverClassName: org.h2.Driver
    username: sa
    password: ''

environments:
    development:
        dataSource:
            dbCreate: create-drop
            url: jdbc:h2:mem:devDb;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
    test:
        dataSource:
            dbCreate: update
            url: jdbc:h2:mem:testDb;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
    production:
        dataSource:
            dbCreate: none
            url: jdbc:h2:./prodDb;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
            properties:
                jmxEnabled: true
                initialSize: 5
                maxActive: 50
                minIdle: 5
                maxIdle: 25
                maxWait: 10000
                maxAge: 600000
                timeBetweenEvictionRunsMillis: 5000
                minEvictableIdleTimeMillis: 60000
                validationQuery: SELECT 1
                validationQueryTimeout: 3
                validationInterval: 15000
                testOnBorrow: true
                testWhileIdle: true
                testOnReturn: false
                jdbcInterceptors: ConnectionState
                defaultTransactionIsolation: 2 # TRANSACTION_READ_COMMITTED

Actual Behaviour

When creating a project with grails 6.0.0 the application.yml file does not have the environments settings at the end as shown below

Steps To Reproduce

curl --location --request GET 'https://grailsforge-latest-cjmq3uyfcq-uc.a.run.app/create/web/com.example.demo?gorm=HIBERNATE&servlet=TOMCAT&test=SPOCK&javaVersion=JDK_11' --output demo.zip unzip demo.zip

Environment Information

Grails Version: 6.0.0

Example Application

No response

Version

6.0.0

xpusostomos commented 1 year ago

Is there anything stopping you from adding them, if your personal requirements benefit?

fernando88to commented 1 year ago

One of the most striking features of Grails is that the application is already configured, I think that new programmers will have to research how to add configurations by environment, since it could already come by default, so it makes it easier.

jamesfredley commented 1 week ago

returning in 6.2.2.