@@ -73,6 +73,7 @@ impl DatabaseError {
7373 }
7474}
7575
76+ /// An alias for [`Result`] that uses [`DatabaseError`] as the error type.
7677pub type Result < T > = std:: result:: Result < T , DatabaseError > ;
7778
7879/// A model trait for database models.
@@ -211,6 +212,8 @@ impl Column {
211212 }
212213}
213214
215+ /// A marker trait that denotes that a type can be used as a primary key in a
216+ /// database.
214217pub trait PrimaryKey : DatabaseField + Clone { }
215218
216219/// A row structure that holds the data of a single row retrieved from the
@@ -913,7 +916,7 @@ pub struct RowsNum(pub u64);
913916/// ```
914917/// use flareon::db::{model, Auto, Model};
915918/// # use flareon::db::migrations::{Field, Operation};
916- /// # use flareon::db::{Database, Identifier};
919+ /// # use flareon::db::{Database, Identifier, DatabaseField };
917920/// # use flareon::Result;
918921///
919922/// #[model]
@@ -925,7 +928,7 @@ pub struct RowsNum(pub u64);
925928/// # async fn main() -> Result<()> {
926929///
927930/// # const OPERATION: Operation = Operation::create_model()
928- /// # .table_name(Identifier::new("todoapp__my_model "))
931+ /// # .table_name(Identifier::new("my_model "))
929932/// # .fields(&[
930933/// # Field::new(Identifier::new("id"), <i32 as DatabaseField>::TYPE)
931934/// # .primary_key()
@@ -1025,6 +1028,8 @@ impl<const LIMIT: u32> PartialEq<LimitedString<LIMIT>> for String {
10251028 }
10261029}
10271030
1031+ /// An error returned by [`LimitedString::new`] when the string is longer than
1032+ /// the specified limit.
10281033#[ derive( Debug , Clone , PartialEq , Eq , PartialOrd , Ord , Hash , Error ) ]
10291034#[ error( "string is too long ({length} > {LIMIT})" ) ]
10301035pub struct NewLimitedStringError < const LIMIT : u32 > {
0 commit comments