Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tyt2y3 committed Jan 8, 2024
1 parent 2ca8d41 commit 6d5b3c0
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/index/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,30 @@ use super::common::*;
/// r#"CREATE INDEX "idx-glyph-aspect" ON "glyph" ("aspect" DESC)"#
/// );
/// ```
/// Index on multi-columns
/// ```
/// use sea_query::{tests_cfg::*, *};
///
/// let index = Index::create()
/// .name("idx-glyph-aspect")
/// .table(Glyph::Table)
/// .col((Glyph::Image, IndexOrder::Asc))
/// .col((Glyph::Aspect, IndexOrder::Desc))
/// .to_owned();
///
/// assert_eq!(
/// index.to_string(MysqlQueryBuilder),
/// r#"CREATE INDEX `idx-glyph-aspect` ON `glyph` (`image` ASC, `aspect` DESC)"#
/// );
/// assert_eq!(
/// index.to_string(PostgresQueryBuilder),
/// r#"CREATE INDEX "idx-glyph-aspect" ON "glyph" ("image" ASC, "aspect" DESC)"#
/// );
/// assert_eq!(
/// index.to_string(SqliteQueryBuilder),
/// r#"CREATE INDEX "idx-glyph-aspect" ON "glyph" ("image" ASC, "aspect" DESC)"#
/// );
/// ```
/// Index with prefix and order
/// ```
/// use sea_query::{tests_cfg::*, *};
Expand Down

0 comments on commit 6d5b3c0

Please sign in to comment.