Open
Description
Currently, the process_bind_param
method on TypeDecorator[_T]
has signature:
Unfortunately, it looks like this is incorrect: I believe it can return anything that the underlying impl
can accept. For instance, in SQLAlchemy's tests there's type decorators that return int
s:
class MyNewIntType(types.TypeDecorator):
impl = Integer
def process_bind_param(self, value, dialect):
return value * 10
def process_result_value(self, value, dialect):
return value * 10
def copy(self):
return MyNewIntType()
The process_bind_param
return value should probably be loosened to match the Optional[Any]
of its inverse operation process_result_value
.
(This probably applies to process_literal_param
too.)
Metadata
Metadata
Assignees
Labels
No labels