@@ -73,6 +73,7 @@ impl DatabaseError {
73
73
}
74
74
}
75
75
76
+ /// An alias for [`Result`] that uses [`DatabaseError`] as the error type.
76
77
pub type Result < T > = std:: result:: Result < T , DatabaseError > ;
77
78
78
79
/// A model trait for database models.
@@ -211,6 +212,8 @@ impl Column {
211
212
}
212
213
}
213
214
215
+ /// A marker trait that denotes that a type can be used as a primary key in a
216
+ /// database.
214
217
pub trait PrimaryKey : DatabaseField + Clone { }
215
218
216
219
/// A row structure that holds the data of a single row retrieved from the
@@ -913,7 +916,7 @@ pub struct RowsNum(pub u64);
913
916
/// ```
914
917
/// use flareon::db::{model, Auto, Model};
915
918
/// # use flareon::db::migrations::{Field, Operation};
916
- /// # use flareon::db::{Database, Identifier};
919
+ /// # use flareon::db::{Database, Identifier, DatabaseField };
917
920
/// # use flareon::Result;
918
921
///
919
922
/// #[model]
@@ -925,7 +928,7 @@ pub struct RowsNum(pub u64);
925
928
/// # async fn main() -> Result<()> {
926
929
///
927
930
/// # const OPERATION: Operation = Operation::create_model()
928
- /// # .table_name(Identifier::new("todoapp__my_model "))
931
+ /// # .table_name(Identifier::new("my_model "))
929
932
/// # .fields(&[
930
933
/// # Field::new(Identifier::new("id"), <i32 as DatabaseField>::TYPE)
931
934
/// # .primary_key()
@@ -1025,6 +1028,8 @@ impl<const LIMIT: u32> PartialEq<LimitedString<LIMIT>> for String {
1025
1028
}
1026
1029
}
1027
1030
1031
+ /// An error returned by [`LimitedString::new`] when the string is longer than
1032
+ /// the specified limit.
1028
1033
#[ derive( Debug , Clone , PartialEq , Eq , PartialOrd , Ord , Hash , Error ) ]
1029
1034
#[ error( "string is too long ({length} > {LIMIT})" ) ]
1030
1035
pub struct NewLimitedStringError < const LIMIT : u32 > {
0 commit comments