database.yml
This document provides an overview of the configuration options available in the database.yml
Database Settings
method: This setting determines the database method used by the application. It's a string value and can be eitherSQLorREDIS.sql: This is a nested setting that contains the configuration for the SQL database. It includes the following sub-settings:method: The specific SQL method to use. It can beMYSQLorSQLITE.host: The host address of the SQL server.port: The port number of the SQL server.database: The name of the database to connect to.username: The username for the SQL server.password: The password for the SQL server.pool-properties: These are properties for the connection pool, includingmaximum-pool-size,minimum-idle,maximum-lifetime,keepalive-time,connection-timeout, anduse-ssl.table-prefix: The prefix to use for table names in the database.
redis: This is a nested setting that contains the configuration for the Redis database. It includes the following sub-settings:type: The type of Redis setup. It can only beSTANDALONE.standalone: This is a nested setting that contains the configuration for a standalone Redis setup. It includeshost,port,user,password, andssl.cluster: This is a nested setting that contains the configuration for a Redis cluster setup. It includesnodes(a list of node addresses),user,password, andssl.
use-cache-when-available: This is a boolean setting that controls whether the application should use cache when it's available.
Here's an example of how these settings might look in the database.yml file:
method: SQL
sql:
method: MYSQL
host: localhost
port: 3306
database: sayanvanish
username: root
password: admin
pool-properties:
maximum-pool-size: 10
minimum-idle: 10
maximum-lifetime: 1800000
keepalive-time: 0
connection-timeout: 5000
use-ssl: false
table-prefix: sayanvanish_
redis:
type: STANDALONE
standalone:
host: localhost
port: 6379
user: ''
password: ''
ssl: false
use-cache-when-available: truePlease note that these settings can be changed according to your requirements. Make sure to restart the application after making any changes for them to take effect.
Important: If you are going to use SQLite as your database method, please note that the proxy mode does not work.
Last updated