Skip to content

Scaffolding setup now supports Firebird 2.5 #976

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

Closed
wants to merge 1 commit into from

Conversation

SJFriedl
Copy link

@SJFriedl SJFriedl commented Aug 1, 2021

This adds scaffolding support for versions of Firebird < 3.0 (tested on 2.5) by eliding the rdb$IDENTITY_TYPE column if the version is too old - it uses the same logic as found in the FbColumns.cs support elsewhere.

This works well enough to create the raft of files representing each table, but it hasn't be tested for anything beyond that as Jiri has said other updates need to be done. So this is only an incremental step.

@@ -192,11 +193,20 @@ ORDER BY

private void GetColumns(DbConnection connection, IReadOnlyList<DatabaseTable> tables, Func<string, string, bool> tableFilter)
{
var identity_type = "null";

if (connection.State == ConnectionState.Open)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point connection is known to be open.


if (connection.State == ConnectionState.Open)
{
var serverVersion = FbServerProperties.ParseServerVersion(connection.ServerVersion);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would put this into DatabaseModel Create(DbConnection connection, DatabaseModelFactoryOptions options) method and create a property for it.

if (connection.State == ConnectionState.Open)
{
var serverVersion = FbServerProperties.ParseServerVersion(connection.ServerVersion);
if (serverVersion.Major >= 3)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Store MajorVersionNumber directly, to make it easier for future.

@cincuranet cincuranet linked an issue Aug 19, 2021 that may be closed by this pull request
@cincuranet
Copy link
Member

@SJFriedl Are you going to finish this PR?

@cincuranet
Copy link
Member

Done via faedc6e.

@cincuranet cincuranet closed this Nov 10, 2021
@lvalgimigli
Copy link

I have this error when scaffolding a 2.5 Firebird database: Could not find type mapping for column 'XXXXX' with data type 'NUMERIC(4,2)'. Skipping column.

@mrotteveel
Copy link
Member

Please report bugs by creating new issues, or if you're asking for help, ask on firebird-net-provider

@cincuranet
Copy link
Member

@mrotteveel He did: #1142.

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

Successfully merging this pull request may close these issues.

EntityFrameworkCore scaffolding does not support Firebird 2.5
4 participants