Use configuration_basic for db_url examples for readability (#19307)

This commit is contained in:
Joakim Sørensen 2021-09-13 09:52:35 +02:00 committed by GitHub
parent b4fafdea08
commit 699d1a9114
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,7 +35,7 @@ recorder:
type: map type: map
keys: keys:
db_url: db_url:
description: The URL that points to your database. description: The URL that points to your database. Examples of these can be found [here](#custom-database-engines).
required: false required: false
type: string type: string
db_max_retries: db_max_retries:
@ -236,23 +236,48 @@ The following database engines are tested when major changes are made to the rec
## Custom database engines ## Custom database engines
| Database engine | `db_url` | Here are examples to use with the [`db_url`](#db_url) configuration option.
| :----------------------------- | :-------------------------------------------------------------------------------------------------------- |
| SQLite | `sqlite:////PATH/TO/DB_NAME` | {% configuration_basic %}
| MariaDB (omit pymysql) | `mysql://user:password@SERVER_IP/DB_NAME?charset=utf8mb4` |
| MariaDB (omit pymysql, Socket) | `mysql://user:password@SERVER_IP/DB_NAME?unix_socket=/var/run/mysqld/mysqld.sock&charset=utf8mb4` | SQLite:
| MySQL | `mysql://SERVER_IP/DB_NAME?charset=utf8mb4` | description: >
| MySQL | `mysql://user:password@SERVER_IP/DB_NAME?charset=utf8mb4` | `sqlite:////PATH/TO/DB_NAME`
| MySQL (Socket) | `mysql://user:password@localhost/DB_NAME?unix_socket=/var/run/mysqld/mysqld.sock&charset=utf8mb4` | MariaDB (omit pymysql):
| MariaDB | `mysql+pymysql://SERVER_IP/DB_NAME?charset=utf8mb4` | description: >
| MariaDB | `mysql+pymysql://user:password@SERVER_IP/DB_NAME?charset=utf8mb4` | `mysql://user:password@SERVER_IP/DB_NAME?charset=utf8mb4`
| MariaDB (Socket) | `mysql+pymysql://user:password@localhost/DB_NAME?unix_socket=/var/run/mysqld/mysqld.sock&charset=utf8mb4` | MariaDB (omit pymysql, Socket):
| PostgreSQL | `postgresql://SERVER_IP/DB_NAME` | description: >
| PostgreSQL | `postgresql://user:password@SERVER_IP/DB_NAME` | `mysql://user:password@SERVER_IP/DB_NAME?unix_socket=/var/run/mysqld/mysqld.sock&charset=utf8mb4`
| PostgreSQL (Socket) | `postgresql://@/DB_NAME` | MySQL:
| PostgreSQL (Custom socket dir) | `postgresql://@/DB_NAME?host=/path/to/dir` | description: >
| MS SQL Server | `mssql+pyodbc://username:password@SERVER_IP:1433/DB_NAME?charset=utf8&driver=DRIVER` | `mysql://user:password@SERVER_IP/DB_NAME?charset=utf8mb4`
| Oracle | `oracle+cx_oracle://username:password@SERVER_IP:1521/DB_NAME?encoding=UTF-8&nencoding=UTF-8` | MySQL (Socket):
description: >
`mysql://user:password@localhost/DB_NAME?unix_socket=/var/run/mysqld/mysqld.sock&charset=utf8mb4`
MariaDB:
description: >
`mysql+pymysql://user:password@SERVER_IP/DB_NAME?charset=utf8mb4`
MariaDB (Socket):
description: >
`mysql+pymysql://user:password@localhost/DB_NAME?unix_socket=/var/run/mysqld/mysqld.sock&charset=utf8mb4`
PostgreSQL:
description: >
`postgresql://user:password@SERVER_IP/DB_NAME`
PostgreSQL (Socket):
description: >
`postgresql://@/DB_NAME`
PostgreSQL (Custom socket dir):
description: >
`postgresql://@/DB_NAME?host=/path/to/dir`
MS SQL Server:
description: >
`mssql+pyodbc://username:password@SERVER_IP:1433/DB_NAME?charset=utf8&driver=DRIVER`
Oracle:
description: >
`oracle+cx_oracle://username:password@SERVER_IP:1521/DB_NAME?encoding=UTF-8&nencoding=UTF-8`
{% endconfiguration_basic %}
<div class='note'> <div class='note'>