Fix compatibility with SQlite

Also fixes a bug in plume-models
This commit is contained in:
Bat
2018-10-06 12:35:58 +01:00
parent 5fa7a2a742
commit 4d382d8014
5 changed files with 16 additions and 12 deletions
+3 -3
View File
@@ -1,8 +1,8 @@
use clap::{Arg, ArgMatches, App, SubCommand};
use diesel::PgConnection;
use std::env;
use plume_models::{
Connection,
instance::*,
safe_string::SafeString,
};
@@ -33,7 +33,7 @@ pub fn command<'a, 'b>() -> App<'a, 'b> {
).about("Create a new local instance"))
}
pub fn run<'a>(args: &ArgMatches<'a>, conn: &PgConnection) {
pub fn run<'a>(args: &ArgMatches<'a>, conn: &Connection) {
let conn = conn;
match args.subcommand() {
("new", Some(x)) => new(x, conn),
@@ -41,7 +41,7 @@ pub fn run<'a>(args: &ArgMatches<'a>, conn: &PgConnection) {
}
}
fn new<'a>(args: &ArgMatches<'a>, conn: &PgConnection) {
fn new<'a>(args: &ArgMatches<'a>, conn: &Connection) {
let domain = args.value_of("domain").map(String::from)
.unwrap_or_else(|| env::var("BASE_URL")
.unwrap_or_else(|_| super::ask_for("Domain name")));