Base on tokio postgres
Keep one postgres connection, will auto reconnect when connect close
基于 tokio postgres , 保留一个 postgres 连接 , 连接关闭时会自动重新连接
use lazy_static;
use ;
use time;
lazy_static!
use Oid;
//
// lazy_static! {
// pub static ref SQL_LI: pgw::Sql = PG.sql("SELECT task.id FROM bot.task,bot.civitai_img WHERE hash IS NOT NULL AND bot.task.rid=bot.civitai_img.id AND task.adult=0 AND cid=1 ORDER BY star DESC LIMIT 512");
// }
//
// pub async fn li() -> Result<Vec<u64>, pgw::Error> {
// Ok(
// PG.query(&*SQL_LI, &[])
// .await?
// .iter()
// .map(|r| r.get::<_, u64>(0))
// .collect(),
// )
// }
async