MCPcopy Index your code
hub / github.com/dataease/SQLBot / get_db

Method get_db

backend/apps/db/constant.py:44–52  ·  view source on GitHub ↗
(cls, type, default_if_none=False)

Source from the content-addressed store, hash-verified

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}")

Callers 13

transTreeItemFunction · 0.80
create_dsFunction · 0.80
fieldEnumFunction · 0.80
get_table_sample_dataFunction · 0.80
create_chatFunction · 0.80
get_db_typeFunction · 0.80
get_sql_templateFunction · 0.80
check_connectionFunction · 0.80
get_versionFunction · 0.80
get_schemaFunction · 0.80
get_tablesFunction · 0.80
get_fieldsFunction · 0.80

Calls 1

equals_ignore_caseFunction · 0.90

Tested by

no test coverage detected