I do not know what a good way to do this. However, this discussion does matter:
http://www.mail-archive.com/ datamapper@googlegroups.com /msg02894.html
You can apparently resume the connection using DataMapper.setup(), but it seems that closing the connections is handled automatically.
However, perhaps these observations will help:
You can save the link to the adapter, for example
a = DataMapper.setup(:default, "sqlite:db/development.sqlite3")
Viewing this object shows that the path has been saved, implying that it is for this particular connection, and not as a SQLite adapter as a whole, or such:
p a
#<DataMapper::Adapters::SqliteAdapter:0x00000001aa9258 @name=:default, @options={"scheme"=>"sqlite", "user"=>nil, "password"=>nil, "host"=>nil, "port"=>nil, "query"=>nil, "fragment"=>nil, "adapter"=>"sqlite3", "path"=>"db/development.sqlite3"}, @resource_naming_convention=DataMapper::NamingConventions::Resource::UnderscoredAndPluralized, @field_naming_convention=DataMapper::NamingConventions::Field::Underscored, @normalized_uri=sqlite3:db/development.sqlite3?scheme=sqlite&user=&password=&host=&port=&query=&fragment=&adapter=sqlite3&path=db/development.sqlite3>
, - - ( nil ?).
close_connection() DataMapper::Adapters::DataObjectsAdapter, , , .
, !