Skip to content

Commit

Permalink
Updated sample code for configuring connections
Browse files Browse the repository at this point in the history
  • Loading branch information
aidanharan committed Oct 10, 2024
1 parent 3bfc000 commit 9d9c87b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
- [#1196](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1196) Use default inspect for database adapter
- [#1216](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1216) Refactor adapter interface to match abstract adapter
- [#1225](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1225) Drop support to Ruby 3.1
- [#1242](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1242) Changed how additional connection configuration is performed

#### Fixed

Expand Down
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,14 @@ configuration then implement the `additional_connection_configuration` method in
example we are setting the `TEXTSIZE` to 64 megabytes.

```ruby
module ActiveRecord
module ConnectionAdapters
class SQLServerAdapter < AbstractAdapter
def additional_connection_configuration
@raw_connection.execute("SET TEXTSIZE #{64.megabytes}").do
end
ActiveRecord::ConnectionAdapters::SQLServerAdapter.prepend(
Module.new do
def configure_connection
super
@raw_connection.execute("SET TEXTSIZE #{64.megabytes}").do
end
end
end
)
```

#### Configure Application Name
Expand Down
6 changes: 0 additions & 6 deletions lib/active_record/connection_adapters/sqlserver_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -521,12 +521,6 @@ def configure_connection

initialize_dateformatter
use_database
additional_connection_configuration
end

# Allow for additional connection configuration by overriding this method.
def additional_connection_configuration
# no-op
end
end
end
Expand Down

0 comments on commit 9d9c87b

Please sign in to comment.