Skip to content

Instantly share code, notes, and snippets.

@IvanShamatov
Last active December 25, 2015 09:44
Show Gist options
  • Save IvanShamatov/1143958b840092d0f3ce to your computer and use it in GitHub Desktop.
Save IvanShamatov/1143958b840092d0f3ce to your computer and use it in GitHub Desktop.
require 'mysql2'
require 'sequel'
names = File.read('somefile').split('\r\n').map(&:strip)
db = Sequel.connect("mysql://username:password@localhost:3306/dbname")
db[:resume].join_table(:left, :user, :id=>:parent).where(name: names).to_a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment