Skip to content

Commit

Permalink
Fix visit_VARCHAR method in IRISTypeCompiler to handle default length…
Browse files Browse the repository at this point in the history
… in IRIS
  • Loading branch information
grongierisc committed Apr 17, 2024
1 parent a1f1328 commit 735a354
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sqlalchemy_iris/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,12 @@ def visit_BOOLEAN(self, type_, **kw):
def visit_BIT(self, type_, **kw):
return "BIT"

def visit_VARCHAR(self, type_, **kw):
# If length is not specified, use 50 as default in IRIS
if type_.length is None:
type_ = VARCHAR(50)
return "VARCHAR(%d)" % type_.length

def visit_TEXT(self, type_, **kw):
return "VARCHAR(65535)"

Expand Down

0 comments on commit 735a354

Please sign in to comment.