On Aug 12, 10:40 am, Piotr Szotkowski <[email protected]> wrote:
> Jeremy Evans:
>
> > Yes. On MySQL, String is varchar(255), while String :text=>true is
> > text. On PostgreSQL, String is text and String :text=>false is varchar
> > (255). This is because MySQL's text type has limitations most users
> > would find unacceptable as the standard string type (e.g. you can't
> > set a default). On PostgreSQL, text doesn't have additional
> > restrictions over varchar(255), so it is used as the additional
> > capacity makes it a better fit for Ruby's String class (which doesn't
> > have a length restriction of 255 characters).
>
> Correct me if I’m wrong, but last time I checked SQLite’s varchar(255)
> can actually store longer strings (does not complan and returns them as
> stored, i.e., not truncated).

You are correct.  SQLite allows you to store pretty much anything in
any column.

> This means that String fields are not truncated on SQLite and PostgreSQL
> while being truncated on MySQL – and if I really want to to have
> a cross-database column for storing long strings I need to use either
> ‘:text’ field type (instead of ‘String’) or ‘String, :text => true’,
> right?

Yes.  For long strings, use String, :text=>true.  That's the cross-
database Sequel way of handling it.

Jeremy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to