Skip to content

Commit dfe9363

Browse files
aidanharanAidan Haran
andauthored
New Rails application instructions (#945)
New Rails application instructions Co-authored-by: Aidan Haran <aharan@fusioneer.com>
1 parent 257312e commit dfe9363

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,16 +152,25 @@ ActiveRecord::ConnectionAdapters::SQLServerAdapter.showplan_option = 'SHOWPLAN_X
152152
**NOTE:** The method we utilize to make SHOWPLANs work is very brittle to complex SQL. There is no getting around this as we have to deconstruct an already prepared statement for the sp_executesql method. If you find that explain breaks your app, simple disable it. Do not open a github issue unless you have a patch. Please [consult the Rails guides](http://guides.rubyonrails.org/active_record_querying.html#running-explain) for more info.
153153

154154

155+
## New Rails Applications
156+
157+
When creating a new Rails application you can specify that you want to use the SQL Server adapter using the `database` option:
158+
159+
```
160+
rails new my_app --database=sqlserver
161+
```
162+
163+
To then connect the application to your SQL Server instance edit the `config/database.yml` file with the username, password and host of your SQL Server instance.
164+
165+
155166
## Installation
156167

157168
The adapter has no strict gem dependencies outside of `ActiveRecord`. You will have to pick a connection mode, the default is dblib which uses the `TinyTDS` gem. Just bundle the gem and the adapter will use it.
158169

159170
```ruby
160-
gem 'tiny_tds'
161171
gem 'activerecord-sqlserver-adapter'
162172
```
163173

164-
165174
## Contributing
166175

167176
If you would like to contribute a feature or bugfix, thanks! To make sure your fix/feature has a high chance of being added, please read the following guidelines. First, ask on the Gitter, or post a ticket on github issues. Second, make sure there are tests! We will not accept any patch that is not tested. Please read the [`RUNNING_UNIT_TESTS`](RUNNING_UNIT_TESTS.md) file for the details of how to run the unit tests.

0 commit comments

Comments
 (0)