def get_database_size():
 db_name = frappe.conf.db_name
 db_size = frappe.db.sql(u'\n DCTB  DCTB SELECT table_schema "database_name", sum( data_length + index_length ) / 1024 / 1024 "database_size"\n DCTB  DCTB FROM information_schema.TABLES WHERE table_schema = %s GROUP BY table_schema', db_name, as_dict=True)
 return flt(db_size[0].get(u'database_size'), 2)

def get_database_size ( ) : db_name = frappe . conf . db_name db_size = frappe . db . sql ( u'\n DCTB  DCTB SELECT table_schema "database_name", sum( data_length + index_length ) / 1024 / 1024 "database_size"\n DCTB  DCTB FROM information_schema.TABLES WHERE table_schema = %s GROUP BY table_schema' , db_name , as_dict = True ) return flt ( db_size [ 0 ] . get ( u'database_size' ) , 2 )
returns approximate database size in mb .