Skip to content

Commit

Permalink
Merge pull request #100 from hackolade/HCK-4155-chulanovskyi-snowflak…
Browse files Browse the repository at this point in the history
…e-re-fixes

fix: packages and languages RE of snowflake UDF's
  • Loading branch information
mtseluiko authored Nov 2, 2023
2 parents 6324264 + 0bfb046 commit 2fbaafd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
11 changes: 6 additions & 5 deletions forward_engineering/ddlProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ module.exports = (baseProvider, options, app) => {
};

const getOrReplaceStatement = (isEnabled) => isEnabled ? ' OR REPLACE' : '';
const getBodyStatement = (body) => body ? `$$\n${body}\n\t$$` : '';
const getBodyStatement = (body) => body ? `\n\t$$\n${body}\n\t$$` : '';
const getCommentsStatement = (text) => text ? `\n\tCOMMENT = '${text}'` : ''
const getNotNullStatement = (isEnabled) => isEnabled ? '\n\tNOT NULL' : '';

Expand Down Expand Up @@ -531,13 +531,14 @@ module.exports = (baseProvider, options, app) => {
.map(udf =>
clean({
name: udf.name || undefined,
orReplace: udf.orReplace || undefined,
orReplace: udf.functionOrReplace || undefined,
language: udf.functionLanguage || udf.storedProcLanguage || undefined,
runtimeVersion: udf.runtimeVersion || undefined,
packages: udf.packages || undefined,
runtimeVersion: udf.functionRuntimeVersion || undefined,
packages: udf.functionPackages || undefined,
arguments: udf.functionArguments || udf.storedProcArgument || undefined,
returnType: udf.functionReturnType || udf.storedProcDataType || undefined,
notNull: udf.notNull || undefined,
notNull: udf.functionNotNull || undefined,
handler: udf.functionHandler || undefined,
function:
udf.functionBody || udf.storedProcFunction
? tab(_.trim(udf.functionBody || udf.storedProcFunction))
Expand Down
14 changes: 4 additions & 10 deletions properties_pane/container_level/containerLevelConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -186,16 +186,10 @@ making sure that you maintain a proper JSON format.
},
{
"propertyName": "Or Replace",
"propertyKeyword": "orReplace",
"propertyKeyword": "functionOrReplace",
"propertyType": "checkbox",
"propertyTooltip": "Specifies that if a UDF with the same name and input argument data types, or signature, as this one already exists, the existing UDF is replaced. You can only replace a UDF with a new UDF that defines an identical set of data types."
},
{
"propertyName": "Temporary",
"propertyKeyword": "temporary",
"propertyType": "checkbox",
"propertyTooltip": "Specifies that the function persists only for the duration of the session that you created it in. A temporary function is dropped at the end of the session."
},
{
"propertyName": "Language",
"propertyKeyword": "functionLanguage",
Expand Down Expand Up @@ -227,13 +221,13 @@ making sure that you maintain a proper JSON format.
},
{
"propertyName": "Not Null",
"propertyKeyword": "notNull",
"propertyKeyword": "functionNotNull",
"propertyType": "checkbox",
"propertyTooltip": "Specifies whether the function can return NULL values or must return only NON-NULL values."
},
{
"propertyName": "Runtime version",
"propertyKeyword": "runtimeVersion",
"propertyKeyword": "functionRuntimeVersion",
"propertyType": "text",
"dependency": {
"type": "or",
Expand All @@ -256,7 +250,7 @@ making sure that you maintain a proper JSON format.
},
{
"propertyName": "Packages",
"propertyKeyword": "packages",
"propertyKeyword": "functionPackages",
"propertyType": "group",
"structure": [
{
Expand Down

0 comments on commit 2fbaafd

Please sign in to comment.