cldwalker/datomic-client — pull request #5 by timcraft (2012-09-30 21:25:06+00:00)
Title: Add convenience method to Datomic::Client for creating db/alias inputs

We can query with a single input like this:

```ruby
datomic.query('...', dbname)
```

This is great. Unfortunately the same does not work for multiple inputs for which we have to specify the db/alias structure in full, like this:

```ruby
datomic.query('...', [{:'db/alias' => "#{storage}/#{dbname}"}, input2])
```

This is not so great. Apart from all the extra typing, it also forces the caller to maintain additional state/knowledge (i.e. the storage value), and it's significantly different from calling with a single input. Ideally we would be able to do this:

```ruby
datomic.query('...', [dbname, input2])
```

We cannot do this because we don't know which of the inputs will be database aliases. So we need some way to mark them explicitly.

This pull request adds the `/` method to Datomic::Client as a convenience shortcut for creating these db/alias inputs. Querying with multiple inputs can then look like this:

```ruby
datomic.query('...', [datomic/dbname, input2])
```

This approach is backwards compatible, the db/alias input can still be specified in full. And it could potentially be extended in the future, e.g. to return an object that represented that specific database with additional behaviour.