Class: OnesnooperServer::Stores::MysqlStore

Inherits:
OnesnooperServer::SqlStore show all
Defined in:
lib/onesnooper_server/stores/mysql_store.rb

Overview

MySQL-based store for production deployments with static table structure.

Constant Summary

Constants inherited from OnesnooperServer::SqlStore

OnesnooperServer::SqlStore::SQL_TABLE_NAME

Instance Method Summary collapse

Methods inherited from OnesnooperServer::SqlStore

#save!

Methods inherited from OnesnooperServer::Store

#save!

Constructor Details

#initialize(params = {}) ⇒ MysqlStore



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/onesnooper_server/stores/mysql_store.rb', line 5

def initialize(params = {})
  super
  @db_conn = ::Sequel.connect(
    :adapter  => 'mysql2',
    :database => params[:database],
    :user     => params[:username],
    :password => params[:password],
    :host     => params[:host],
    :port     => params[:port],
  )
end