<commit_before>
## SHORT TERM

Misc remidners while in the heat of adapting the adpater.

* Review coerced tests.

## LONG TERM

After we get some tests passing

* Is `primary_keys(table_name)` performant? Contribute to rails for abstract adapter.
* Check `sql_for_insert` can do without the table regular expresion.
* Do we need the `query_requires_identity_insert` check in `execute`?
* Does the schema cache serialize properly since we conform to that now?
* What does `supports_materialized_views?` means for SQL Server
  http://michaeljswart.com/2014/12/materialized-views-in-sql-server/
  https://blogs.msdn.microsoft.com/ssma/2011/06/20/migrating-oracle-materialized-view-to-sql-server/
  http://stackoverflow.com/questions/3986366/how-to-create-materialized-views-in-sql-server
* BIGINT PK support. https://github.com/rails/rails/pull/26266


#### Does Find By SQL Work?

With binds and prepareable?

```ruby
#   Post.find_by_sql ["SELECT title FROM posts WHERE author = ? AND created > ?", author_id, start_date]
#   Post.find_by_sql ["SELECT body FROM comments WHERE author = :user_id OR approved_by = :user_id", { :user_id => user_id }]
#
def find_by_sql(sql, binds = [], preparable: nil)
  result_set = connection.select_all(sanitize_sql(sql), "#{name} Load", binds, preparable: preparable)
```<commit_msg>TODO - Can we use `OPTIMIZE FOR UNKNOWN` [ci skip]<commit_after>
## SHORT TERM

Misc remidners while in the heat of adapting the adpater.

* Review coerced tests.

## LONG TERM

After we get some tests passing

* Is `primary_keys(table_name)` performant? Contribute to rails for abstract adapter.
* Check `sql_for_insert` can do without the table regular expresion.
* Do we need the `query_requires_identity_insert` check in `execute`?
* Does the schema cache serialize properly since we conform to that now?
* What does `supports_materialized_views?` means for SQL Server
  http://michaeljswart.com/2014/12/materialized-views-in-sql-server/
  https://blogs.msdn.microsoft.com/ssma/2011/06/20/migrating-oracle-materialized-view-to-sql-server/
  http://stackoverflow.com/questions/3986366/how-to-create-materialized-views-in-sql-server
* BIGINT PK support. https://github.com/rails/rails/pull/26266
* Can we use `OPTIMIZE FOR UNKNOWN`
  http://sqlblog.com/blogs/aaron_bertrand/archive/2011/09/17/bad-habits-to-kick-using-exec-instead-of-sp-executesql.aspx
  http://stackoverflow.com/questions/24016199/sql-server-stored-procedure-become-very-slow-raw-sql-query-is-still-very-fast
  https://blogs.msdn.microsoft.com/sqlprogrammability/2008/11/26/optimize-for-unknown-a-little-known-sql-server-2008-feature/


#### Does Find By SQL Work?

With binds and prepareable?

```ruby
#   Post.find_by_sql ["SELECT title FROM posts WHERE author = ? AND created > ?", author_id, start_date]
#   Post.find_by_sql ["SELECT body FROM comments WHERE author = :user_id OR approved_by = :user_id", { :user_id => user_id }]
#
def find_by_sql(sql, binds = [], preparable: nil)
  result_set = connection.select_all(sanitize_sql(sql), "#{name} Load", binds, preparable: preparable)
```
{'fraction_non_alphanumeric': 0.12077922077922078, 'fraction_numerical': 0.025974025974025976, 'mean_word_length': 4.769662921348314, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 5, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '427050', 'n_tokens_mistral': 1122, 'n_tokens_neox': 1018, 'n_words': 261}