(cls, type, default_if_none=False)
| 42 | |
| 43 | @classmethod |
| 44 | def get_db(cls, type, default_if_none=False): |
| 45 | for db in cls: |
| 46 | """ if db.type == type: """ |
| 47 | if equals_ignore_case(db.type, type): |
| 48 | return db |
| 49 | if default_if_none: |
| 50 | return DB.pg |
| 51 | else: |
| 52 | raise ValueError(f"Invalid db type: {type}") |
no test coverage detected