不要怂,就是干,撸起袖子干!

Commit 0db96d34 by Sushant Committed by GitHub

feat(describeTable): support string length for mssql (#9896)

1 parent cb48ef17
...@@ -211,6 +211,14 @@ class Query extends AbstractQuery { ...@@ -211,6 +211,14 @@ class Query extends AbstractQuery {
autoIncrement: _result.IsIdentity === 1, autoIncrement: _result.IsIdentity === 1,
comment: _result.Comment comment: _result.Comment
}; };
if (
result[_result.Name].type.includes('VARCHAR')
&& _result.Length
) {
result[_result.Name].type += `(${_result.Length})`;
}
} }
} else if (this.isShowIndexesQuery()) { } else if (this.isShowIndexesQuery()) {
result = this.handleShowIndexesQuery(data); result = this.handleShowIndexesQuery(data);
......
...@@ -50,7 +50,7 @@ describe(Support.getTestDialectTeaser('QueryInterface'), () => { ...@@ -50,7 +50,7 @@ describe(Support.getTestDialectTeaser('QueryInterface'), () => {
assertVal = 'CHARACTER VARYING(255)'; assertVal = 'CHARACTER VARYING(255)';
break; break;
case 'mssql': case 'mssql':
assertVal = 'NVARCHAR'; assertVal = 'NVARCHAR(255)';
break; break;
} }
expect(username.type).to.equal(assertVal); expect(username.type).to.equal(assertVal);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!