Running direct diesel sql query
This commit is contained in:
@@ -4,6 +4,7 @@ use std::env;
|
||||
use commands::audio::create_response;
|
||||
use diesel::r2d2::{Pool, ConnectionManager};
|
||||
use diesel::pg::PgConnection;
|
||||
|
||||
use dotenv::dotenv;
|
||||
use log::{error, warn, info};
|
||||
use serenity::async_trait;
|
||||
@@ -18,6 +19,8 @@ use songbird::SerenityInit;
|
||||
mod commands;
|
||||
mod database;
|
||||
|
||||
pub const MIGRATIONS: diesel_migrations::EmbeddedMigrations = diesel_migrations::embed_migrations!("migrations");
|
||||
|
||||
struct Handler {
|
||||
// Open AI Config
|
||||
oai: Option<commands::oai::OAI>,
|
||||
@@ -116,7 +119,7 @@ async fn main() {
|
||||
};
|
||||
|
||||
let pool = database::establish_connection();
|
||||
// database::run_migrations(&pool);
|
||||
database::run_migrations(&pool);
|
||||
|
||||
let handler = match env::var("OPENAI_API_KEY") {
|
||||
Ok(token) => {
|
||||
@@ -135,9 +138,7 @@ async fn main() {
|
||||
let mut client = Client::builder(token, intents)
|
||||
.event_handler(handler)
|
||||
.framework(StandardFramework::new()
|
||||
.configure(|c| c
|
||||
.owners(owners)
|
||||
))
|
||||
.configure(|c| c.owners(owners)))
|
||||
.register_songbird()
|
||||
.await
|
||||
.expect("Error creating client");
|
||||
|
||||
Reference in New Issue
Block a user