这是一个简单的数据库连接,并且查询对我有用;
postgre_conn = PG::Connection.open(:host => 'dbsvr', :user => 'csdashboard', :password => 'csdashboard', :dbname => 'csdashboard')
@filtered_snort_detail_query = postgre_conn.exec("SELECT * from event where timestamp >= (now() - '1 day'::INTERVAL);")
如何告诉pg使用database.yml文件获取连接信息?
#
#
Closed issue
#
#
我很遗憾每个人都有时间,我想我这样做是错的。由于这是一个数据库函数,我认为首先需要由模型定义。很抱歉...