Skip to content

Instantly share code, notes, and snippets.

@miyucy
Created August 26, 2010 12:09
Show Gist options
  • Save miyucy/551284 to your computer and use it in GitHub Desktop.
Save miyucy/551284 to your computer and use it in GitHub Desktop.
require './handler_socket'
require 'pp'
if false
require 'rubygems'
require 'active_support'
require 'active_record'
ActiveRecord::Base.establish_connection(:adapter => 'mysql',
:encoding => 'utf8',
:host => 'localhost',
:database => 'test')
connection = ActiveRecord::Base.connection
1000.times{ |count|
connection.execute "INSERT INTO table1 (`k`, `v`) VALUES('#{count}', '#{ActiveSupport::SecureRandom.hex}')"
}
end
hs = HandlerSocket.new(:host => 'localhost', :port => '9998')
pp hs
pp hs.open_index(1, 'test', 'table1', 'PRIMARY', 'k,v')
pp hs.execute_single(1, '=', ['1'], 1, 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment