Merge branch 'main' into wip/images
This commit is contained in:
commit
149b81973d
54 changed files with 1201 additions and 1691 deletions
|
@ -1,8 +1,7 @@
|
|||
use crate::Error;
|
||||
use bunny_api_tokio::edge_storage::Endpoint;
|
||||
use crate::error::Error;
|
||||
use log::debug;
|
||||
use serde::Deserialize;
|
||||
use sqlx::postgres::PgConnectOptions;
|
||||
use tokio::fs::read_to_string;
|
||||
use url::Url;
|
||||
|
||||
|
@ -122,13 +121,24 @@ pub struct Bunny {
|
|||
}
|
||||
|
||||
impl Database {
|
||||
pub fn connect_options(&self) -> PgConnectOptions {
|
||||
PgConnectOptions::new()
|
||||
.database(&self.database)
|
||||
.host(&self.host)
|
||||
.username(&self.username)
|
||||
.password(&self.password)
|
||||
.port(self.port)
|
||||
pub fn url(&self) -> String {
|
||||
let mut url = String::from("postgres://");
|
||||
|
||||
url += &self.username;
|
||||
|
||||
url += ":";
|
||||
url += &self.password;
|
||||
|
||||
url += "@";
|
||||
|
||||
url += &self.host;
|
||||
url += ":";
|
||||
url += &self.port.to_string();
|
||||
|
||||
url += "/";
|
||||
url += &self.database;
|
||||
|
||||
url
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue