Skip to content

Commit

Permalink
fix: create tag/edge statement with empty [NULL|NOT NULL] value (#762)
Browse files Browse the repository at this point in the history
mod: version@3.9.1
  • Loading branch information
huaxiabuluo authored Feb 2, 2024
1 parent 97d2508 commit f48cef7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions app/utils/gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,11 @@ export const getTagOrEdgeCreateGQL = (params: {
}
const _type =
item.type !== 'fixed_string' ? item.type : item.type + `(${item.fixedLength ? item.fixedLength : ''})`;
const _null = item.allowNull ? 'NULL' : 'NOT NULL';
// `[NULL | NOT NULL]` is not required
// in `CREATE TAG` or `CREATE EDGE` statement, the default value is `NULL` if not specified
const _null = item.allowNull === undefined ? '' : item.allowNull ? 'NULL' : 'NOT NULL';
const _comment = item.comment ? `COMMENT "${handleEscape(item.comment)}"` : '';
const conbine = [handleKeyword(item.name), _type, _null, valueStr, _comment];
const conbine = [handleKeyword(item.name), _type, _null, valueStr, _comment].filter(Boolean);
return conbine.join(' ');
})
.join(', ')
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nebula-graph-studio",
"version": "3.9.0",
"version": "3.9.1",
"description": "nebula-graph-studio",
"private": true,
"repository": {
Expand Down

0 comments on commit f48cef7

Please sign in to comment.