DatabaseCleaner / database_cleaner-active_record

Strategies for cleaning databases using ActiveRecord. Can be used to ensure a clean state for testing.
MIT License
64 stars 63 forks source link

Add SQLServerAdapter with view_cache override method #35

Closed botandrose closed 4 months ago

botandrose commented 4 years ago

Copied from https://github.com/DatabaseCleaner/database_cleaner/pull/578

I created a SQLServerAdapter to so I could override the implementation of the database_cleaner_view_cache method since sql server.

The other option was to change the underlying implementation of https://github.com/DatabaseCleaner/database_cleaner/blame/master/lib/database_cleaner/active_record/truncation.rb#L25 I'm not sure why this is part of the base implementation?

 where table_schema = '#{current_database}'
botandrose commented 4 years ago

@ablignaut Now that we have restored dependency sanity and can test against real implementations, I'd like to get a failing test that this PR fixes, before merging it in.

Admittedly, this is kind of a yak shave, because there's doesn't seem to be a directly supported way to test with SqlServer on Travis. I've been looking at https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/blob/master/.travis.yml and it looks like its possible, though. Would you be interested in taking a crack at this? If not, I'll get around to it at some point.

etagwerker commented 1 year ago

@botandrose Sorry for the delay. It seems that there are conflicts in the PR. Could you please look into it?

Thanks!

etagwerker commented 4 months ago

Closing this due to inactivity. If you want to re-open it later, go for it. ❤️