extract the value under the key 'database' from the options dictionary, use the value for indexing connections list, substitute the result for connection.
connection = connections [ options [ 'database' ] ]