sunitparekh / data-anonymization

Want to use production data for testing, data-anonymization can help you.
MIT License
459 stars 92 forks source link

Using it with MSSQL Server #63

Open yasin-amadmia-mck opened 6 years ago

yasin-amadmia-mck commented 6 years ago

Hi, Can it be used with MsSQL Server ? Possibly using https://github.com/rails-sqlserver/activerecord-sqlserver-adapter ? I actually installed the sqlserver-adapter and then when i do

require 'data-anonymization'
require 'activerecord-sqlserver-adapter'

database 'Test_DB' do
  strategy DataAnon::Strategy::Blacklist
  source_db :adapter => 'SQLServerAdapter', :host => 'x', :port => 999, :username => 'x', :password => 'x', :database => 'x'

  table 'Persons' do
    anonymize('FirstName').using FieldStrategy::RandomString.new
  end

end

It throws this error

/usr/lib/ruby/2.4.0/rubygems/specification.rb:2294:in `raise_if_conflicts': Unable to activate activerecord-sqlserver-adapter-5.1.6, because activerecord-5.0.7 conflicts with activerecord (~> 5.1.0) (Gem::ConflictError)
        from /usr/lib/ruby/2.4.0/rubygems/specification.rb:1414:in `activate'
        from /usr/lib/ruby/2.4.0/rubygems.rb:220:in `rescue in try_activate'
        from /usr/lib/ruby/2.4.0/rubygems.rb:213:in `try_activate'
        from /usr/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:126:in `rescue in require'
        from /usr/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:39:in `require'
        from /var/lib/gems/2.4.0/gems/activesupport-5.0.7/lib/active_support/dependencies.rb:293:in `block in require'
        from /var/lib/gems/2.4.0/gems/activesupport-5.0.7/lib/active_support/dependencies.rb:259:in `load_dependency'
        from /var/lib/gems/2.4.0/gems/activesupport-5.0.7/lib/active_support/dependencies.rb:293:in `require'
        from test.rb:2:in `<main>'
sunitparekh commented 6 years ago

It is difficult for me to get all setup done on Mac for SQL Server and try it. If this doesn't work for you. Give a try to Java/Kotlin port of same tool which works with JDBC driver. https://github.com/dataanon/data-anon

to kickstart you can use Kotlin sample or Java Sample