Fix for delimiting table-names (and supporting queries covering multi-db or multi-schema) #105
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch is for fixing the way of delimiting table-names. At same time, we can support Postgres' schema and queries covering multiple databases with this patch.
This patch will fix the issue #98 too.
In MySQL, it is very usual that an query use multiple databases like bellow:
Korma currently don't support this kind of query well, because Korma don't delimit table-names correctly.
Think about a situation where we use multiple database. We probably define entites with db-name like bellow:
and query:
Korma will generate an query like:
This query doesn't work. We should delimit table-names like bellow:
If korma delimit table-names as above, users of mysql can use multi-db well, and at same time, users of postgres can use schema-name as well.
With my patch, Korma will delimit table-names like the last example.