Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Can't seem to get :truncation to work with MS SQL Server

Aperta
#8 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
ruby, sql
Ambito
databases, testing

Direzione di ricerca

Inizia riproducendo il fallimento RSpec segnalato con la strategia :truncation di DatabaseCleaner, activerecord-sqlserver-adapter e la configurazione database.yml descritta qui. Non sono indicati file sorgente né test; il lavoro è completato quando si è stabilito se il supporto per SQL Server è incompatibile o configurato in modo errato e si è aggiunto un test di regressione mirato oppure documentata la configurazione richiesta.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Ruby
Stelle
76
Fork
76
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di DatabaseCleaner/database_cleaner-active_record

Tutte le issue di DatabaseCleaner/database_cleaner-active_record

Issue simili

Altre issue su Ruby

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.