Mysql
 sql >> Baza danych >  >> RDS >> Mysql

Wiele sprzężeń z SQLAlchemy

Oprzyj swoje dalsze sprzężenia na utworzonych aliasach:

Distributor.query\
    .outerjoin(alias_commercial_address, Distributor.commercial_address)\
    .outerjoin(alias_commercial_address_country, alias_commercial_address.country)\
    .outerjoin(alias_invoice_address, Distributor.invoice_address)\
    .outerjoin(alias_invoice_address_country, alias_invoice_address.country)\
    .options(contains_eager(Distributor.commercial_address, alias=alias_commercial_address)
             .contains_eager(alias_commercial_address.country, alias=alias_commercial_address_country),
             contains_eager(Distributor.invoice_address, alias=alias_invoice_address)
             .contains_eager(alias_invoice_address.country, alias=alias_invoice_address_country))\
    .all()



  1. Database
  2.   
  3. Mysql
  4.   
  5. Oracle
  6.   
  7. Sqlserver
  8.   
  9. PostgreSQL
  10.   
  11. Access
  12.   
  13. SQLite
  14.   
  15. MariaDB
  1. Odniesienie do grup w regexie MySQL?

  2. PHP zmienia stare mysql_query na PDO

  3. jetty-env.xml z DataSource prowadzi do awarii WebAppContext na mvn jetty:run

  4. wybieranie kolejnych liczb za pomocą zapytania SQL

  5. błąd node-mysql:połącz ECONNREFUSED