Skip to content

Commit

Permalink
Update SnowflakeAppGenerator.java
Browse files Browse the repository at this point in the history
  • Loading branch information
Yasirmod17 authored Jul 16, 2024
1 parent e2c1164 commit 7d92931
Showing 1 changed file with 0 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,8 @@ public class SnowflakeAppGenerator
{

public static SnowflakeAppArtifact generateArtifact(PureModel pureModel, Root_meta_external_function_activator_snowflakeApp_SnowflakeApp activator, PureModelContext inputModel, Function<PureModel, RichIterable<? extends Root_meta_pure_extension_Extension>> routerExtensions)
{
return generateArtifact(pureModel, activator, inputModel, false, routerExtensions);
}

public static SnowflakeAppArtifact generateArtifact(PureModel pureModel, Root_meta_external_function_activator_snowflakeApp_SnowflakeApp activator, PureModelContext inputModel, boolean createStatementOnly, Function<PureModel, RichIterable<? extends Root_meta_pure_extension_Extension>> routerExtensions)
{
Root_meta_external_function_activator_snowflakeApp_generation_Artifact fullArtifact = core_snowflakeapp_generation_generation.Root_meta_external_function_activator_snowflakeApp_generation_generateFullArtifact_SnowflakeApp_1__Extension_MANY__Artifact_1_(activator, routerExtensions.apply(pureModel), pureModel.getExecutionSupport());

String sqlFunctionExpression = core_snowflakeapp_generation_generation.Root_meta_external_function_activator_snowflakeApp_generation_generateArtifact_SnowflakeApp_1__Extension_MANY__String_1_(activator, routerExtensions.apply(pureModel), pureModel.getExecutionSupport());
String inputParamStub = core_snowflakeapp_generation_generation.Root_meta_external_function_activator_snowflakeApp_generation_generateInputParamsStub_Function_1__Boolean_1__String_1_(activator._function(), false, pureModel.getExecutionSupport());
RelationalDatabaseConnection connection;
AlloySDLC sdlc = null;
if (((PureModelContextData)inputModel).getOrigin() != null)
Expand All @@ -73,11 +65,6 @@ public static SnowflakeAppArtifact generateArtifact(PureModel pureModel, Root_me
.select(c -> c.getPath().equals(((org.finos.legend.engine.protocol.snowflakeApp.metamodel.SnowflakeAppDeploymentConfiguration)protocolActivator.activationConfiguration).activationConnection.connection)).getFirst().connectionValue;
SnowflakeDatasourceSpecification ds = (SnowflakeDatasourceSpecification)connection.datasourceSpecification;
String deployedLocation = String.format("https://app.%s.privatelink.snowflakecomputing.com/%s/%s/data/databases/%S", ds.region, ds.region, ds.accountName, ds.databaseName);
if (!createStatementOnly)
{
String generatedGrantStatement = generateGrantStatement(activator._applicationName(), inputParamStub);
content.addGrantStatement(generatedGrantStatement);
}
return new SnowflakeAppArtifact(content, new SnowflakeAppDeploymentConfiguration(connection), deployedLocation, sdlc);
}
return new SnowflakeAppArtifact(content, sdlc);
Expand Down

0 comments on commit 7d92931

Please sign in to comment.