Skip to content

Commit

Permalink
CLOB type needed
Browse files Browse the repository at this point in the history
  • Loading branch information
alattner committed Jun 16, 2015
1 parent e1b758e commit 73ed6e7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions palladium/persistence.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from threading import Lock

from sqlalchemy import create_engine
from sqlalchemy import CLOB
from sqlalchemy import Column
from sqlalchemy import ForeignKey
from sqlalchemy import Integer
Expand Down Expand Up @@ -359,12 +360,12 @@ def _upgrade_1_0(self):
class DatabaseCLOB(Database):
"""A :class:`~palladium.interfaces.ModelPersister` derived from
:class:`Database`, with only the slight difference of using
VARCHAR instead of BLOB to store the pickle data.
CLOB instead of BLOB to store the pickle data.
Use when BLOB is not available.
"""
class BytesToBase64Type(TypeDecorator):
impl = STRINGTYPE
impl = CLOB

def process_bind_param(self, value, dialect):
if value is not None:
Expand All @@ -382,8 +383,7 @@ class DBModelChunk(Base):
id = Column(Integer, primary_key=True)
model_version = Column(
ForeignKey('{}.version'.format(self._table_postfix('models'))))
blob = Column(self.BytesToBase64Type(
String(length=10 ** 6 * 2)), nullable=False)
blob = Column(self.BytesToBase64Type(String()), nullable=False)
return DBModelChunk


Expand Down

0 comments on commit 73ed6e7

Please sign in to comment.