Skip to content

Commit 27ae20a

Browse files
committed
use mysql's default string length for mariadb
1 parent c75743d commit 27ae20a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sqlmodel/sql/sqltypes.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ class AutoString(types.TypeDecorator): # type: ignore
1414

1515
def load_dialect_impl(self, dialect: Dialect) -> "types.TypeEngine[Any]":
1616
impl = cast(types.String, self.impl)
17-
if impl.length is None and dialect.name == "mysql":
17+
if impl.length is None and (
18+
dialect.name == "mysql" or dialect.name == "mariadb"
19+
):
1820
return dialect.type_descriptor(types.String(self.mysql_default_length))
1921
return super().load_dialect_impl(dialect)
2022

0 commit comments

Comments
 (0)