Can't seem to get :truncation to work with MS SQL Server
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start by reproducing the reported RSpec failure with DatabaseCleaner’s :truncation strategy, the activerecord-sqlserver-adapter, and the database.yml configuration described here. No source file or test is named; done means identifying whether SQL Server support is incompatible or misconfigured and adding a focused regression test or documenting the required setup.
Written by the indexing model from the issue text.
Description
Hi, so im at wits end trying to get this to work. Right now were connecting to MS SQL Server (2014) VM using the Activerecord gem for SQL Server: gem 'activerecord-sqlserver-adapter'
I can't seem to get DB Cleaner to work with this. It's worked great in the past using capybara/selenium webdriver.
I know you have to set it to use truncation strategy, but even putting:
DatabaseCleaner.strategy = :truncation
DatabaseCleaner.clean_with(:truncation)
DatabaseCleaner.start
at the beginning of a "it" rspec test, it complains about invalid object name instantly once it gets to that test:
Failure/Error: DatabaseCleaner.clean_with(:truncation)
ActiveRecord::StatementInvalid:
TinyTds::Error: Invalid object name 'user_table'.: DELETE FROM [user_table];
(user_table is just an example here)
I ensured it's connecting to the right database because when I take out Database cleaner it works just fine and I can see the database being populated correctly. So I know my database.yml is set up correctly.
Im not really sure what to try here, or if it's just an incompatibility with SQL Server perhaps? I can't seem to find many examples of people using DB Cleaner and SQL Server.
- Dominant language
- Ruby
- Stars
- 76
- Forks
- 76
- PR merge metrics
- No merged PRs in 30d
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from DatabaseCleaner/database_cleaner-active_record
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
DatabaseCleaner/database_cleaner-active_record#128 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
DatabaseCleaner/database_cleaner-active_record#127 · 3 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
All issues in DatabaseCleaner/database_cleaner-active_record
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
rails/mission_control-jobs#347 ·
-
PROJECT: ILR/DRS
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
thewca/worldcubeassociation.org#15914 ·
Maintainers usually reply within 1 day
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
benbalter/site-inspector#127 ·
Maintainers usually reply within 1 day
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
benbalter/jekyll-remote-theme#168 ·
Maintainers usually reply within 1 day
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
benbalter/jekyll-titles-from-headings#109 ·
Maintainers usually reply within 1 day