strange problem here:
I have a mirrored SQL alchemy class that looks like this:
class Install(Base):
__tablename__ = 'install'
id = Column(Integer, primary_key=True)
ip_address = Column(Integer)
I will convert the string representation ("1.2.3.4") to int using:
struct.unpack('!L', socket.inet_aton(ip_address))[0]
This works, I made sure that it converts IP correctly. However, when I look at the database, most of them are truncated to "2147483647"
2147483647 I can’t find out how to stop this truncation, I know that MySQL can handle this, why does SQLAlchemy do this with my integers?
Thanks in advance!
source
share