mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #24454 from iangilfillan/master
MariaDB documentation [ci skip]
This commit is contained in:
commit
91798c75bc
4 changed files with 15 additions and 13 deletions
|
@ -353,7 +353,7 @@ end
|
|||
```
|
||||
|
||||
will append `ENGINE=BLACKHOLE` to the SQL statement used to create the table
|
||||
(when using MySQL, the default is `ENGINE=InnoDB`).
|
||||
(when using MySQL or MariaDB, the default is `ENGINE=InnoDB`).
|
||||
|
||||
### Creating a Join Table
|
||||
|
||||
|
@ -970,7 +970,7 @@ this, then you should set the schema format to `:sql`.
|
|||
Instead of using Active Record's schema dumper, the database's structure will
|
||||
be dumped using a tool specific to the database (via the `db:structure:dump`
|
||||
rails task) into `db/structure.sql`. For example, for PostgreSQL, the `pg_dump`
|
||||
utility is used. For MySQL, this file will contain the output of
|
||||
utility is used. For MySQL and MariaDB, this file will contain the output of
|
||||
`SHOW CREATE TABLE` for the various tables.
|
||||
|
||||
Loading these schemas is simply a question of executing the SQL statements they
|
||||
|
|
|
@ -50,7 +50,7 @@ class Role < ApplicationRecord
|
|||
end
|
||||
```
|
||||
|
||||
Active Record will perform queries on the database for you and is compatible with most database systems (MySQL, PostgreSQL and SQLite to name a few). Regardless of which database system you're using, the Active Record method format will always be the same.
|
||||
Active Record will perform queries on the database for you and is compatible with most database systems, including MySQL, MariaDB, PostgreSQL and SQLite. Regardless of which database system you're using, the Active Record method format will always be the same.
|
||||
|
||||
Retrieving Objects from the Database
|
||||
------------------------------------
|
||||
|
@ -1915,7 +1915,7 @@ EXPLAIN for: SELECT `users`.* FROM `users` INNER JOIN `articles` ON `articles`.`
|
|||
2 rows in set (0.00 sec)
|
||||
```
|
||||
|
||||
under MySQL.
|
||||
under MySQL and MariaDB.
|
||||
|
||||
Active Record performs a pretty printing that emulates that of the
|
||||
corresponding database shell. So, the same query running with the
|
||||
|
@ -1975,7 +1975,7 @@ EXPLAIN for: SELECT `articles`.* FROM `articles` WHERE `articles`.`user_id` IN
|
|||
1 row in set (0.00 sec)
|
||||
```
|
||||
|
||||
under MySQL.
|
||||
under MySQL and MariaDB.
|
||||
|
||||
### Interpreting EXPLAIN
|
||||
|
||||
|
@ -1986,4 +1986,6 @@ following pointers may be helpful:
|
|||
|
||||
* MySQL: [EXPLAIN Output Format](http://dev.mysql.com/doc/refman/5.7/en/explain-output.html)
|
||||
|
||||
* MariaDB: [EXPLAIN](https://mariadb.com/kb/en/mariadb/explain/)
|
||||
|
||||
* PostgreSQL: [Using EXPLAIN](http://www.postgresql.org/docs/current/static/using-explain.html)
|
||||
|
|
|
@ -326,7 +326,7 @@ With the `helper` method it is possible to access Rails and your application's h
|
|||
|
||||
### `rails dbconsole`
|
||||
|
||||
`rails dbconsole` figures out which database you're using and drops you into whichever command line interface you would use with it (and figures out the command line parameters to give to it, too!). It supports MySQL, PostgreSQL and SQLite3.
|
||||
`rails dbconsole` figures out which database you're using and drops you into whichever command line interface you would use with it (and figures out the command line parameters to give to it, too!). It supports MySQL (including MariaDB), PostgreSQL and SQLite3.
|
||||
|
||||
INFO: You can also use the alias "db" to invoke the dbconsole: `rails db`.
|
||||
|
||||
|
|
|
@ -336,7 +336,7 @@ All these configuration options are delegated to the `I18n` library.
|
|||
|
||||
The MySQL adapter adds one additional configuration option:
|
||||
|
||||
* `ActiveRecord::ConnectionAdapters::Mysql2Adapter.emulate_booleans` controls whether Active Record will consider all `tinyint(1)` columns in a MySQL database to be booleans and is true by default.
|
||||
* `ActiveRecord::ConnectionAdapters::Mysql2Adapter.emulate_booleans` controls whether Active Record will consider all `tinyint(1)` columns as booleans. True by default.
|
||||
|
||||
The schema dumper adds one additional configuration option:
|
||||
|
||||
|
@ -784,11 +784,11 @@ development:
|
|||
timeout: 5000
|
||||
```
|
||||
|
||||
NOTE: Rails uses an SQLite3 database for data storage by default because it is a zero configuration database that just works. Rails also supports MySQL and PostgreSQL "out of the box", and has plugins for many database systems. If you are using a database in a production environment Rails most likely has an adapter for it.
|
||||
NOTE: Rails uses an SQLite3 database for data storage by default because it is a zero configuration database that just works. Rails also supports MySQL (including MariaDB) and PostgreSQL "out of the box", and has plugins for many database systems. If you are using a database in a production environment Rails most likely has an adapter for it.
|
||||
|
||||
#### Configuring a MySQL Database
|
||||
#### Configuring a MySQL or MariaDB Database
|
||||
|
||||
If you choose to use MySQL instead of the shipped SQLite3 database, your `config/database.yml` will look a little different. Here's the development section:
|
||||
If you choose to use MySQL or MariaDB instead of the shipped SQLite3 database, your `config/database.yml` will look a little different. Here's the development section:
|
||||
|
||||
```yaml
|
||||
development:
|
||||
|
@ -801,7 +801,7 @@ development:
|
|||
socket: /tmp/mysql.sock
|
||||
```
|
||||
|
||||
If your development computer's MySQL installation includes a root user with an empty password, this configuration should work for you. Otherwise, change the username and password in the `development` section as appropriate.
|
||||
If your development database has a root user with an empty password, this configuration should work for you. Otherwise, change the username and password in the `development` section as appropriate.
|
||||
|
||||
#### Configuring a PostgreSQL Database
|
||||
|
||||
|
@ -843,9 +843,9 @@ development:
|
|||
database: db/development.sqlite3
|
||||
```
|
||||
|
||||
#### Configuring a MySQL Database for JRuby Platform
|
||||
#### Configuring a MySQL or MariaDB Database for JRuby Platform
|
||||
|
||||
If you choose to use MySQL and are using JRuby, your `config/database.yml` will look a little different. Here's the development section:
|
||||
If you choose to use MySQL or MariaDB and are using JRuby, your `config/database.yml` will look a little different. Here's the development section:
|
||||
|
||||
```yaml
|
||||
development:
|
||||
|
|
Loading…
Reference in a new issue