get the value under the 'database' key of the options dictionary, if it doesnt exists use the DEFAULT_DB_ALIAS to address an element
connection = connections [ options . get ( 'database' , DEFAULT_DB_ALIAS ) ]