Skip to content

#23 add LONGVARCHAR type support and corresponding tests #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions sqlalchemy_iris/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,9 @@ def visit_TEXT(self, type_, **kw):
def visit_LONGVARBINARY(self, type_, **kw):
return "LONGVARBINARY"

def visit_LONGVARCHAR(self, type_, **kw):
return "LONGVARCHAR"

def visit_DOUBLE(self, type_, **kw):
return "DOUBLE"

Expand Down
29 changes: 29 additions & 0 deletions tests/test_alembic.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from sqlalchemy_iris import LONGVARCHAR


try:
import alembic # noqa
except: # noqa
Expand Down Expand Up @@ -128,3 +131,29 @@ def test_str_to_blob(self, connection, ops_context):
assert col["name"] == "col"
assert isinstance(col["type"], LONGVARBINARY)
assert not col["nullable"]

class TestIRISLONGVARCHAR(TestBase):

@fixture
def tables(self, connection):
self.meta = MetaData()
self.tbl = Table(
"longvarbinary_test",
self.meta,
Column("id", Integer, primary_key=True),
Column("data", LONGVARCHAR),
)
self.meta.create_all(connection)
yield
self.meta.drop_all(connection)

def test_longvarchar(self, connection, tables):
connection.execute(
self.tbl.insert(),
[
{"data": "test data"},
{"data": "more test data"},
],
)
result = connection.execute(self.tbl.select()).fetchall()
assert result == [(1, "test data"), (2, "more test data")]
Loading