activerecord-sqlserver-adapter icon indicating copy to clipboard operation
activerecord-sqlserver-adapter copied to clipboard

Add compatibility_level config

Open slavad opened this issue 1 year ago • 3 comments

Issue

You can't specify compatibility_level in the db config

Expected behavior

You should be able to do this

Actual behavior

If I add compatibility_level: 130 in database.yml, it's ignored, the compatibility level is set to 140 (default for my db version)

How to reproduce

Add compatibility_level: 130 to the db config in database.yml

Details

  • Rails version: n/a
  • SQL Server adapter version: n/a
  • TinyTDS version: n/a
  • FreeTDS details: n/a

I forked the repo and added this feature. Is it ok if I create a pull request?

The feature branch was branched off the tag v7.2.1

slavad avatar Oct 18 '24 10:10 slavad

@slavad Why would you change the compatibility level of a database when you connect to it? If it's a once off task then doing it manually would be better.

aidanharan avatar Oct 18 '24 11:10 aidanharan

@aidanharan no, the compatibility level would be set during creation.

The compatibility_level setting would work like the collation setting (both in database.yml)

slavad avatar Oct 20 '24 09:10 slavad

@aidanharan check this out https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1254

slavad avatar Oct 25 '24 09:10 slavad