I have a class that needs to have TEXT up to about 300k characters and it’s stored in a PostgreSQL db.
Postgres itself has no problem with megabyte blobs, (eventually I will store them in S3), but Datamapper has a default limit of ’65k characters’ for a TEXT:
By default, DataMapper supports the following primitive types:
- TrueClass, Boolean
- String
- Text (limit of 65k characters by default)
I want to do something like
property :id, Serial
property :name, String, :index => true
property :posted, DateTime
property :info, DataMapper::Types::Text, :lazy => false
property :data, DataMapper::Types::Text, :limit => 500000 # needs to be big is :limit correct?5
I know the lazy part is OK, because I got it from http://datamapper.rubyforge.org/dm-core/DataMapper/Property.html — but what is the keyword to use to override the limit on a TEXT field:
:length?:maximum?:limit?
Or something else?
OK,
Turns out :length does work.