def db_get(name, **connection_args):
 dbc = _connect(**connection_args)
 if (dbc is None):
  return []
 cur = dbc.cursor()
 qry = 'SELECT DEFAULT_CHARACTER_SET_NAME, DEFAULT_COLLATION_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME=%(dbname)s;'
 args = {'dbname': name}
 _execute(cur, qry, args)
 if cur.rowcount:
  rows = cur.fetchall()
  return {'character_set': rows[0][0], 'collate': rows[0][1]}
 return {}

def db_get ( name , ** connection_args ) : dbc = _connect ( ** connection_args ) if ( dbc is None ) : return [ ] cur = dbc . cursor ( ) qry = 'SELECT DEFAULT_CHARACTER_SET_NAME, DEFAULT_COLLATION_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME=%(dbname)s;' args = { 'dbname' : name } _execute ( cur , qry , args ) if cur . rowcount : rows = cur . fetchall ( ) return { 'character_set' : rows [ 0 ] [ 0 ] , 'collate' : rows [ 0 ] [ 1 ] } return { }
return a list of databases of a mysql server using the output from the select default_character_set_name .