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

feat(core): include development, test and production dataSource configuration #389

Merged
merged 3 commits into from
Oct 10, 2024

Conversation

jamesfredley
Copy link
Contributor

Include development, test and production dataSource configuration in generated application.yml

Normally this would be part of a minor release, but given that it was lost between 5.3.x and 6.0.0 it is more of a fix than a feature.

The goal is to match the configuration from Grails 5.3.6:

dataSource:
  driverClassName: org.h2.Driver
  username: sa
  password: ''
  pooled: true
  jmxExport: true
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

@jamesfredley jamesfredley changed the title include development, test and production dataSource configuration feat(core): include development, test and production dataSource configuration Oct 9, 2024
@jamesfredley jamesfredley self-assigned this Oct 9, 2024
@fernando88to
Copy link
Contributor

I'm glad this feature is coming back.

Copy link
Contributor

@matrei matrei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@jamesfredley jamesfredley merged commit c6d6fac into 6.2.x Oct 10, 2024
10 checks passed
@jamesfredley jamesfredley deleted the generate-environment-data-sources branch October 10, 2024 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Grails Forge: in application.yml add environment specific database configuration
5 participants