Sha256: 78eecbaf2e1541403cd704898eedb997c056067e6117a063d0fd315dfc97ae40

Contents?: true

Size: 518 Bytes

Versions: 1

Compression:

Stored size: 518 Bytes

Contents

class DjExample

  attr_accessor :user
  attr_accessor :pass
  attr_accessor :host
  attr_accessor :db
  attr_accessor :table


  def initialize(opts={})
    @user = opts[:user]
    @pass = opts[:pass]
    @host = opts[:host]
    @db = opts[:db]
    @table = opts[:table]
  end


  # this is a pretty lame example that uses command line mysql client instead of mysql2
  def queue_size
    `mysql -u #{user} -p'#{pass}' -h #{host} --silent --skip-column-names #{db} --execute 'select count(*) from #{table}'`
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
growing_queue_condition-0.0.1 examples/mysql_example.rb