Construct a VARBINARY type. :param length: optional, a length for the column for use in DDL statements, for those binary types that accept a length, such as the MySQL BLOB type. :param filestream=False: if True, renders the ``FILESTREAM`` keyword
(self, length=None, filestream=False)
| 1474 | __visit_name__ = "VARBINARY" |
| 1475 | |
| 1476 | def __init__(self, length=None, filestream=False): |
| 1477 | """ |
| 1478 | Construct a VARBINARY type. |
| 1479 | |
| 1480 | :param length: optional, a length for the column for use in |
| 1481 | DDL statements, for those binary types that accept a length, |
| 1482 | such as the MySQL BLOB type. |
| 1483 | |
| 1484 | :param filestream=False: if True, renders the ``FILESTREAM`` keyword |
| 1485 | in the table definition. In this case ``length`` must be ``None`` |
| 1486 | or ``'max'``. |
| 1487 | |
| 1488 | .. versionadded:: 1.4.31 |
| 1489 | |
| 1490 | """ |
| 1491 | |
| 1492 | self.filestream = filestream |
| 1493 | if self.filestream and length not in (None, "max"): |
| 1494 | raise ValueError( |
| 1495 | "length must be None or 'max' when setting filestream" |
| 1496 | ) |
| 1497 | super().__init__(length=length) |
| 1498 | |
| 1499 | |
| 1500 | class IMAGE(sqltypes.LargeBinary): |