Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ad-hoc table renaming #2921

Closed
lukaseder opened this issue Dec 30, 2013 · 0 comments
Closed

Add support for ad-hoc table renaming #2921

lukaseder opened this issue Dec 30, 2013 · 0 comments

Comments

@lukaseder
Copy link
Member

Being able to scope schema and table renaming for a whole Configuration through Settings is nice for multi-tenancy but not for sharding. Users who are sharding their tables should be able to rename the "base table" on the fly for ad-hoc usage. Example:

SELECT * FROM t1 -- t1 is renamed from t
UNION
SELECT * FROM t2 -- t2 is renamed from t

In the above example, the table T is renamed twice in the same query, once to T1, and once to T2.

Note that in this context, renaming is not the same as aliasing! Renaming is only performed in Java memory prior to rendering SQL, whereas aliasing is performed in the SQL statement itself.


As table renaming is not really a SQL DSL feature, the rename() method should be generated onto generated tables only, instead of being declared in org.jooq.Table

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant