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 Sequence flags in meta model #7752
Comments
Looking at the interfaces which describe the information schema ( Number getStartWith();
Number getIncrementBy();
Number getMinValue();
Number getMaxValue();
Boolean isCycle();
Number getCache(); @lukaseder: 1) We can replace all Trying to devise this API raised a few questions, which I think need to be discussed:
@lukaseder What is your take on this? |
Should the Java code generator also "support" these flags? I.e. generate static |
Yes, correct, that is the historic convention in the jOOQ API, which mixes meta data navigation and DSL:
Having said so...
I think we should use the alternative I'm not sure if we already have a precedent for a boolean value in the meta APIs... I will comment to your various bullets directly inline, by editing your comment.
Yes of course! All representations of
Yes, sure. A separate issue is fine. |
So in summary you propose to:
|
Yes, it makes sense anyway. The
Sure we can do that for now.
We generally don't do that as there's always one RDBMS that does support arbitrary We shouldn't limit our main product offering (generic DSL, parser, etc.) because one of our features (interpreter) cannot handle the entirety of possible use cases (yet). We can throw a meaningful error message in case a non- Notice that there are a few other types of |
Adds the following methods to the `Sequence` interface: `getStartWith()`, `getIncrementBy()`, `getMinValue()`, `getMaxValue()`, `getCycle()`, and `getCache()`. The `Sequence` objects returned by the `DDLInterpreter` now return the expected values when these methods are called. And `DDL` (aka `DSLContext#ddl()`) queries these methods to create a corresponding `CREATE SEQUENCE` query.
@lukaseder Can you please review 5949f1c? |
@knutwannheden I did |
To prevent merge conflicts, as the |
In order to implement the
|
I've added a new, separate issue for code generation support for these flags: #9442 |
Note: The RESTART clause has no effect.
I've added a bullet for #9603. We don't have to reopen this issue for that... |
The
CREATE SEQUENCE
statement supports a few flags that have a representation in many databases. Other flags might simply be ignored. The DDL statement has already been implemented: #7748. Now, we also need access to these flags from the meta model in order to be able to recreate the correct DDL statement from the meta data.Here are these flags:
INCREMENT BY
MINVALUE
/NO MINVALUE
MAXVALUE
/NO MAXVALUE
START WITH
CACHE
CYCLE
/NO CYCLE
Once we have these flags, they need to be:
DSLContext.ddl()
Meta.diff(Meta)
ALTER SEQUENCE .. RESTART
emulationjooq-meta.xsd
supportSee also:
The text was updated successfully, but these errors were encountered: