Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking rails/solid_cache compatibility #1122

Open
jonahgeorge opened this issue Oct 17, 2023 · 0 comments
Open

Tracking rails/solid_cache compatibility #1122

jonahgeorge opened this issue Oct 17, 2023 · 0 comments
Labels

Comments

@jonahgeorge
Copy link
Contributor

With the announcement of rails/solid_cache at RailsWorld 2023, I wanted to see if it would work with activerecord-sqlserver-adapter... a few findings:

Usage of unique index on varbinary column

https://github.com/rails/solid_cache/blob/main/db/migrate/20230724121448_create_solid_cache_entries.rb#L8

ActiveRecord::StatementInvalid: TinyTds::Error: Column 'key' in table 'solid_cache_entries' is of a type that is invalid for use as a key column in an index.
/Users/jonahgeorge/src/solid_cache/test/dummy/db/schema.rb:14:in `block in <top (required)>'
/Users/jonahgeorge/src/solid_cache/test/dummy/db/schema.rb:13:in `<top (required)>'

Caused by:
TinyTds::Error: Column 'key' in table 'solid_cache_entries' is of a type that is invalid for use as a key column in an index.
/Users/jonahgeorge/src/solid_cache/test/dummy/db/schema.rb:14:in `block in <top (required)>'
/Users/jonahgeorge/src/solid_cache/test/dummy/db/schema.rb:13:in `<top (required)>'
Tasks: TOP => db:setup => app:db:setup => app:db:schema:load

This one seems fairly easy to resolve, an option in the upstream project to enable the usage of text fields rather than binary fields seems like something that could get accepted. AFAICT they're only using binary fields for minor performance gains.

Lack of upsert support

https://github.com/rails/solid_cache/blob/e4865809025d650736d818fce26d09737f6623b1/app/models/solid_cache/entry.rb#L74-L83

Error:
SolidCacheFailsafeTest#test_fetch_multi_failure_returns_fallback_results:
ArgumentError: ActiveRecord::ConnectionAdapters::SQLServerAdapter does not support upsert

Tracking Issue: #859

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants