-
-
Notifications
You must be signed in to change notification settings - Fork 74
Changes for DNET-784: schema update for identity #7
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
Conversation
Added a refactoring to FbSchema so the major version number is stored in the object. This then is used to conditionally configure the schema query for the Columns schema so it obtains rdb$relation_fields.rdb$identity_type. In the returned datatable a new column IS_IDENTITY is added, type bool, which is set to true if the identity_type field in the resultset is 1.
|
Firebird 4 introduces |
|
Is there any documentation regarding what the difference is between |
|
See Firebird 3 release notes, Identity Column Type and Firebird 4 beta 2 release notes on page 74. The types are as defined in the SQL:2016 standard. |
|
Thanks. So, at the risk of falling into bikeshedding territory ;), is the 'IS_IDENTITY' column(bool) covering enough? As it loses the information if one could assign a value to the identity column. Might be better perhaps to change it into IDENTITY_TYPE (like it is in the meta-data as well) and set it to NULL if not an identity type and 0 or 1 if it is (so just return the IDENTITY_TYPE column as-is) ? |
|
I'll leave that decision to Jiri. I don't know if For comparison, in JDBC (Java), there is the |
| coll.rdb$collation_name AS COLLATION_NAME, | ||
| rfr.rdb$description AS DESCRIPTION | ||
| rfr.rdb$description AS DESCRIPTION"); | ||
| if(this.MajorVersionNumber >= 3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Missing space after if: if (....
Provider/src/FirebirdSql.Data.FirebirdClient/Schema/FbColumns.cs
Outdated
Show resolved
Hide resolved
Provider/src/FirebirdSql.Data.FirebirdClient/Schema/FbColumns.cs
Outdated
Show resolved
Hide resolved
Provider/src/FirebirdSql.Data.FirebirdClient/Schema/FbColumns.cs
Outdated
Show resolved
Hide resolved
Provider/src/FirebirdSql.Data.FirebirdClient/Schema/FbSchema.cs
Outdated
Show resolved
Hide resolved
Provider/src/FirebirdSql.Data.FirebirdClient/Schema/FbColumns.cs
Outdated
Show resolved
Hide resolved
Provider/src/FirebirdSql.Data.FirebirdClient/Schema/FbSchema.cs
Outdated
Show resolved
Hide resolved
|
These schema tables vary by provider and are only partly unified. From my POV, having simple |
|
For me it's enough to know a field is an identity field, but I can see the benefit for the off chance you'd want to know if the field can be written to or not: IDENTITY_TYPE would cover both situations, while IS_IDENTITY would not. So exposing IDENTITY_TYPE in the view would cover both situations. It's a tiny bit less convenient to use (a nullable int instead of a bool) perhaps ... I'll make the changes you requested in the review. |
|
My vote goes to Also it can be changed later, if some valuable scenario is shown. |
|
Ok, I'll leave it as IS_IDENTITY and it will be set to true if IDENTITY_TYPE is not null. :) |
|
I've made the requested changes :) |
Provider/src/FirebirdSql.Data.FirebirdClient/Schema/FbColumns.cs
Outdated
Show resolved
Hide resolved
Provider/src/FirebirdSql.Data.FirebirdClient/Schema/FbColumns.cs
Outdated
Show resolved
Hide resolved
Provider/src/FirebirdSql.Data.FirebirdClient/Schema/FbSchema.cs
Outdated
Show resolved
Hide resolved
|
Few minor nits. I'll merge later today/tomorrow. Thanks! |
|
Changes made :) |
This reverts commit 2c182bf.
Added a refactoring to FbSchema so the major version number is stored in the object. This then is used to conditionally configure the schema query for the Columns schema so it obtains rdb$relation_fields.rdb$identity_type.
In the returned datatable a new column IS_IDENTITY is added, type bool, which is set to true if the identity_type field in the resultset is 1.