Skip to content

Instantly share code, notes, and snippets.

@localytics-gist
Last active June 9, 2017 13:47
Show Gist options
  • Save localytics-gist/36201ead570f76526219ff18b7b83f72 to your computer and use it in GitHub Desktop.
Save localytics-gist/36201ead570f76526219ff18b7b83f72 to your computer and use it in GitHub Desktop.
Sandbox for connecting to ODBC
#!/usr/bin/env ruby
require 'bundler/inline'
gemfile(true) do
source 'https://rubygems.org'
gem 'activerecord', '5.0.3'
gem 'odbc_adapter', '5.0.3'
end
require 'active_record'
require 'logger'
ActiveRecord::Base.establish_connection(adapter: 'odbc', dsn: ARGV.shift)
ActiveRecord::Base.logger = Logger.new(STDOUT)
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
end
require 'irb'
IRB.start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment