Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
fernando88to opened this issue Aug 9, 2023 · 3 comments · Fixed by #389
Closed
Assignees

Comments

@fernando88to
Copy link
Contributor

fernando88to commented Aug 9, 2023

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
Copy link

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

@fernando88to
Copy link
Contributor Author

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.

puneetbehl referenced this issue Mar 7, 2024
This will add datasource config for each environments (development, test, and production).

Fixes grails/grails-core#13103
@jamesfredley jamesfredley transferred this issue from grails/grails-core Sep 27, 2024
@jamesfredley jamesfredley changed the title In the application.yml file without environments settings Grails Forge: In the application.yml file without environments settings Sep 27, 2024
@jamesfredley jamesfredley changed the title Grails Forge: In the application.yml file without environments settings Grails Forge: in application.yml add environment specific database configuration Oct 9, 2024
@jamesfredley
Copy link
Contributor

returning in 6.2.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants