[storm] length of table fields

Gustavo Niemeyer gustavo at niemeyer.net
Sat Sep 1 15:47:38 BST 2007


Hello Sven,

> I'm started testing storm. A really nice ORM :)
> 
> One thing that the documentation doesn't describe is how to declare the field 
> length of string and numeric types to storm.
> 
> shortly, how to declare storm a field as varchar(32) (=> UNICODE(...?)) or 
> numeric(10,2) (INT(...?))

Can you describe your use case?

In Storm you can simply use Unicode for any database column that would
store encoded strings, and you can use Float or Decimal for the numeric
column.  You can see a table with the mapping between Storm and database
types at https://storm.canonical.com/Manual

Notice that we will support more constraints future versions, to
transform errors that would be database constraint issues into Python-side
errors.  OTOH, I'm not sure if we'll ever support constraints such as
the equivalent of "numeric(10,2)", because that would mean limiting the
precision of Python-side operations unnecessarily.

-- 
Gustavo Niemeyer
http://niemeyer.net



More information about the storm mailing list