If the
value is set to true, the connection uses asynchronous query methods, which will help
prevent the Ruby threads from deadlocking. The default value is false, which uses blocking
query methods.
encoding: Optional parameter that allows you to specify the encoding to use.
The following example shows how to open an Active Record database connection for
PostgreSQL:
ActiveRecord::Base.establish_connection(:adapter => "postgresql",
:database => "test", :username => "kevin", :password => "test")
SQLite Parameters
The minimum SQLite requirements are the adapter and database parameters. Here is the
complete list of parameters to consider:
adapter: Specifies that this is connection information for a SQLite database. The value
should be sqlite.
database: The name of the database that you are attempting to connect to.
The following example shows how to open an Active Record database connection for
SQLite:
ActiveRecord::Base.establish_connection(:adapter => "sqlite", :database => "test")
SQL Server Parameters
The minimum SQL Server requirements are the adapter and the database parameters.
Pages:
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80