drizzle_core/traits/foreign_key.rs
1/// A foreign key described by types, generated by the table macros.
2pub trait SQLForeignKey {
3 /// The table that declares the key.
4 type SourceTable;
5 /// The table the key references.
6 type TargetTable;
7 /// The key's columns in the source table, as a tuple.
8 type SourceColumns;
9 /// The referenced columns in the target table, as a tuple.
10 type TargetColumns;
11}
12
13/// Marker used for columns that do not define a foreign key.
14pub struct NoForeignKey;
15
16impl SQLForeignKey for NoForeignKey {
17 type SourceTable = ();
18 type TargetTable = ();
19 type SourceColumns = ();
20 type TargetColumns = ();
21}