Skip to content

Commit 3bfc000

Browse files
committed
Changed how additional connection configuration is performed
1 parent 68d1c0f commit 3bfc000

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- [#1196](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1196) Use default inspect for database adapter
1111
- [#1216](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1216) Refactor adapter interface to match abstract adapter
1212
- [#1225](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1225) Drop support to Ruby 3.1
13+
- [#1242](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1242) Changed how additional connection configuration is performed
1314

1415
#### Fixed
1516

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,14 @@ end
101101
#### Configure Connection
102102

103103
The adapter conforms to the AbstractAdapter interface to configure connections. If you require additional connection
104-
configuration then implement the `configure_connection` method in an initializer like so. In the following
104+
configuration then implement the `additional_connection_configuration` method in an initializer like so. In the following
105105
example we are setting the `TEXTSIZE` to 64 megabytes.
106106

107107
```ruby
108108
module ActiveRecord
109109
module ConnectionAdapters
110110
class SQLServerAdapter < AbstractAdapter
111-
def configure_connection
112-
super
111+
def additional_connection_configuration
113112
@raw_connection.execute("SET TEXTSIZE #{64.megabytes}").do
114113
end
115114
end

lib/active_record/connection_adapters/sqlserver_adapter.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,12 @@ def configure_connection
521521

522522
initialize_dateformatter
523523
use_database
524+
additional_connection_configuration
525+
end
526+
527+
# Allow for additional connection configuration by overriding this method.
528+
def additional_connection_configuration
529+
# no-op
524530
end
525531
end
526532
end

0 commit comments

Comments
 (0)