(db: &C)
| 484 | } |
| 485 | |
| 486 | fn query_mysql_foreign_keys<C>(db: &C) -> SelectStatement |
| 487 | where |
| 488 | C: ConnectionTrait, |
| 489 | { |
| 490 | let mut stmt = Query::select(); |
| 491 | stmt.columns([ |
| 492 | InformationSchema::TableName, |
| 493 | InformationSchema::ConstraintName, |
| 494 | ]) |
| 495 | .from(( |
| 496 | InformationSchema::Schema, |
| 497 | InformationSchema::TableConstraints, |
| 498 | )) |
| 499 | .cond_where( |
| 500 | Condition::all() |
| 501 | .add(get_current_schema(db).equals(( |
| 502 | InformationSchema::TableConstraints, |
| 503 | InformationSchema::TableSchema, |
| 504 | ))) |
| 505 | .add( |
| 506 | Expr::col(( |
| 507 | InformationSchema::TableConstraints, |
| 508 | InformationSchema::ConstraintType, |
| 509 | )) |
| 510 | .eq("FOREIGN KEY"), |
| 511 | ), |
| 512 | ); |
| 513 | stmt |
| 514 | } |
| 515 | |
| 516 | #[derive(DeriveIden)] |
| 517 | enum PgType { |
no test coverage detected