goodybag/mongo-sql — pull request #89 by jrf0110 (2014-03-28 19:42:20+00:00)
Title: Queries to tables in other schemas

I have a project that requires queries to tables in another schema. So far I have been able to access the tables by adding double quotes around the table definition:
```
{ table: '"schema"."table"' }
```
But this does not work when it comes to table joins as the buildJoin in helpers/query/joins.js adds the double quotes around join.target (line 31) giving this output:
```
select * from "table" inner join ""schema"."table"" on "table"."id" = "schema"."table"."other_id"
```
I as able to get around this for now by removing the double quotes in buildJoin on my local copy but should there be a set way of using schema definitions such as a schema property, examples:
```
{
type: 'select'
, table: 'users'
, schema: 'other_schema'
}

select * from "other_schema"."users"

{
type: 'select'
, table: 'users'
, joins: [
{
type: 'left'
, target: "books"
, schema: 'other_schema'
, on: {
userId: '$users.id$'
}
}
]
}

select * from "users" left join "other_schema"."books" on "other_schema"."books"."userId" = "users"."id"
```

I'm happy to contribute based on a consensus on the appropriate solution.