Skip to content

Commit 735a354

Browse files
committed
Fix visit_VARCHAR method in IRISTypeCompiler to handle default length in IRIS
1 parent a1f1328 commit 735a354

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

sqlalchemy_iris/base.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,12 @@ def visit_BOOLEAN(self, type_, **kw):
742742
def visit_BIT(self, type_, **kw):
743743
return "BIT"
744744

745+
def visit_VARCHAR(self, type_, **kw):
746+
# If length is not specified, use 50 as default in IRIS
747+
if type_.length is None:
748+
type_ = VARCHAR(50)
749+
return "VARCHAR(%d)" % type_.length
750+
745751
def visit_TEXT(self, type_, **kw):
746752
return "VARCHAR(65535)"
747753

0 commit comments

Comments
 (0)