sea_query/foreign_key/
mod.rs

1//! Foreign key definition & alternations statements.
2//!
3//! # Usage
4//!
5//! - Table Foreign Key Create, see [`ForeignKeyCreateStatement`]
6//! - Table Foreign Key Drop, see [`ForeignKeyDropStatement`]
7
8mod common;
9mod create;
10mod drop;
11
12pub use common::*;
13pub use create::*;
14pub use drop::*;
15
16/// Shorthand for constructing any foreign key statement
17#[derive(Debug, Clone)]
18pub struct ForeignKey;
19
20/// All available types of foreign key statement
21#[derive(Debug, Clone)]
22pub enum ForeignKeyStatement {
23    Create(ForeignKeyCreateStatement),
24    Drop(ForeignKeyDropStatement),
25}
26
27impl ForeignKey {
28    /// Construct foreign key [`ForeignKeyCreateStatement`]
29    pub fn create() -> ForeignKeyCreateStatement {
30        ForeignKeyCreateStatement::new()
31    }
32
33    /// Construct foreign key [`ForeignKeyDropStatement`]
34    pub fn drop() -> ForeignKeyDropStatement {
35        ForeignKeyDropStatement::new()
36    }
37}