get the value under the key 'database' of the options dictionary, use it as a index to get an element from connections, substitute it for connection.
connection = connections [ options [ 'database' ] ]