diff --git a/src/graphql.rs b/src/graphql.rs
index 3dbe984..a5ea9cf 100644
--- a/src/graphql.rs
+++ b/src/graphql.rs
@@ -1,4 +1,3 @@
-use std::marker::PhantomData;
use juniper::{
EmptyMutation,
EmptySubscription,
@@ -7,24 +6,102 @@ use juniper::{
graphql_object,
GraphQLObject,
GraphQLEnum,
+ FieldResult,
+ FieldError,
};
use sqlx::{
- SqlitePool,
types::chrono::{
DateTime,
Utc,
},
+ FromRow,
+ Encode,
+ Decode,
+ Type,
+ Row,
+ Result as SqlxResult,
+ Error as SqlxError,
+};
+#[cfg(feature = "sqlite")]
+use sqlx::{
+ SqlitePool,
+ sqlite::SqliteRow,
};
use url::Url;
-#[derive(Clone, Copy, Debug)]
-pub struct Context<'db> {
- db: &'db SqlitePool,
+fn into_user_limit(
+ #[cfg(feature = "sqlite")]
+ row: &SqliteRow,
+ index: &str
+) -> SqlxResult