Faveod / arel-extensions

Extending Arel
MIT License
142 stars 24 forks source link

SQL Server fixes #62

Closed stackmystack closed 2 years ago

stackmystack commented 2 years ago

Contains fixes to the MS SQL Server test suite.

In addition to the making all the tests pass, this series of patches:

  1. Contain patches for other platforms (e.g. sqlite), and
  2. Introduces flakiness for the to_sql tests.

Point (1.) is a side effect of rails 7 libraries. Point (2.) is the result of making the test work: the helper introduced in commit cc6fedff, and called in 5d5ea3d, 24020f51, e7240642, etc. replaces the way introspection to get columns and their types used to be done.

Indeed, we now rely on the schema_cache stored in the DB connection itself to get column-level, db, information.

A possible fix for to_sql is creating a (or using a pre-existing) Mock ActiveRecord Adapter, and replace the current method used in the test.