mirror of
https://git.alemi.dev/guestbook.rs.git
synced 2024-11-12 19:39:28 +01:00
fix: solve warnings when not all features
This commit is contained in:
parent
06bfb9157b
commit
beb80cc183
2 changed files with 6 additions and 2 deletions
|
@ -1,10 +1,11 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use axum::{Json, Form, Router, routing::{put, post, get}, extract::{State, Query}, response::{Redirect, Html}};
|
||||
use axum::{Json, Form, Router, routing::{put, post, get}, extract::{State, Query}, response::Redirect};
|
||||
|
||||
use crate::{notifications::NotificationProcessor, model::{Page, PageOptions, PageInsertion, PageView}, storage::StorageProvider, config::ConfigRouting};
|
||||
|
||||
pub fn create_router_with_app_routes(state: Context) -> Router {
|
||||
#[allow(unused_mut)]
|
||||
let mut router = Router::new()
|
||||
.route("/api", get(get_suggestion))
|
||||
.route("/api", post(send_suggestion_form))
|
||||
|
@ -14,6 +15,7 @@ pub fn create_router_with_app_routes(state: Context) -> Router {
|
|||
{
|
||||
use sailfish::TemplateOnce;
|
||||
use axum_extra::response::{Css, JavaScript};
|
||||
use axum::response::Html;
|
||||
|
||||
let template = crate::web::IndexTemplate::from(&state.template)
|
||||
.render_once()
|
||||
|
|
|
@ -27,6 +27,7 @@ pub struct StorageProvider {
|
|||
// https://github.com/launchbadge/sqlx/issues/2778
|
||||
// so the `public` field is an integer which is ridicolous
|
||||
|
||||
#[cfg(any(feature = "sqlite", feature = "mysql"))]
|
||||
const SQLITE_SCHEMA : &str = "
|
||||
CREATE TABLE IF NOT EXISTS pages (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
|
@ -36,8 +37,9 @@ CREATE TABLE IF NOT EXISTS pages (
|
|||
timestamp INTEGER NOT NULL,
|
||||
public INTEGER NOT NULL
|
||||
);
|
||||
";
|
||||
"; // TODO make schema specific for mysql
|
||||
|
||||
#[cfg(feature = "postgres")]
|
||||
const POSTGRES_SCHEMA : &str = "
|
||||
CREATE TABLE IF NOT EXISTS pages (
|
||||
id SERIAL PRIMARY KEY,
|
||||
|
|
Loading…
Reference in a new issue