This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi Jeremy. Thanks for inviting feedback regarding SimpleDB. I have a feature request. It pains me to think that I have to work with strings when I access a SimpleDB entity. Would it be possible to add functionality into lightspeed to say "this attribute is a boolean" - where it expects say 0 1 False True to represent a true/false bit. The same for an "integer" column would also be great. In fact for every data type would be good. Bert |
|
|
We actually do this up to a point, that point being the limitations imposed by SimpleDB's query mechanism. Thus, for example, if you have a People domain with Name and Age attributes, LightSpeed will be happy to treat Age as an integer -- provided, of course, that the values of the Age attribute are convertible to integers. (If some item has an Age of SEVENTEEN, you're out of luck.) So you can work with SimpleDB items as strongly-typed entities. (I have not yet tested this with all data types; in particular I expect I will need to special-case dates.) However, when you perform queries, SimpleDB always performs lexical comparisons. Thus, to SimpleDB, an Age of 17 is less than an Age of 2, because as strings "17" < "2". Therefore if you issue a LightSpeed query such as: var youngsters = from p in uow.People where p.Age < 9; this will get translated to a SimpleDB query of 'Age' < '9' and you will get back everyone aged 89 or less or 100 or more! Amazon's solution to this is to zero-pad values in the database and in queries, so that an age of 89 would be represented as '089' and the query as 'Age' < '009'. Similarly one would represent dates using a standard sortable date-time pattern e.g. ISO 8601 (the .NET "s" or "u" format). LightSpeed doesn't currently allow for this but I'm hoping to come up with some solution for it before we formally ship 2.2. P.S. JD has been making excuses all morning. |
|