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

Fixes attempt to scaffold triggers on synapse re: issue #30998 #31001

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,11 @@ FROM [sys].[views] AS [v]
GetColumns(connection, tables, filter, viewFilter, typeAliases, databaseCollation);
GetIndexes(connection, tables, filter);
GetForeignKeys(connection, tables, filter);
GetTriggers(connection, tables, filter);

if (SupportsTriggers())
{
GetTriggers(connection, tables, filter);
}

foreach (var table in tables)
{
Expand Down Expand Up @@ -1343,6 +1347,9 @@ private bool SupportsMemoryOptimizedTable()
private bool SupportsSequences()
=> _compatibilityLevel >= 110 && _engineEdition != 6;

private bool SupportsTriggers()
Copy link
Contributor

Choose a reason for hiding this comment

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

You should add 11 and 1000 as well.

Copy link
Member

Choose a reason for hiding this comment

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

Looking at the other Supports methods, is it correct to say that Synapse can be detected by checking if _engineEdition is 6, 11 or 1000? If so, we should extract an IsSynapse private property that does that and reuse that everywhere...

Copy link
Contributor

Choose a reason for hiding this comment

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

11 and 1000 are not Synapse Serverless Pool, on 6 is. 11 is Data Warehouse, and 1000 is Dynamics CRM TDS endpoint

Copy link
Member

Choose a reason for hiding this comment

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

OK - I still think it would make the code more readable to have at least constants for this to make the code more readable.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree that constants would improved readability/understanding

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Great, we should probably just have an EngineEdition enum...

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@memory-thrasher memory-thrasher May 31, 2023

Choose a reason for hiding this comment

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

I see in the docs that 11 is synapse serverless pool, but what is 1000?

Copy link
Contributor

Choose a reason for hiding this comment

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

1000 is the second link: Dynamics CRM TDS Endpoint

=> _engineEdition != 6;

private static string DisplayName(string? schema, string name)
=> (!string.IsNullOrEmpty(schema) ? schema + "." : "") + name;

Expand Down