Quantcast
Viewing all articles
Browse latest Browse all 8068

Alloy Model with SQLite - Array/reference column?

Just started using Titanium and Alloy last week!

Is it possible to have a column that is an array, or perhaps a reference to another collection, when using the "sql" adapter?

If not, what is the "best practices" method of storing a set of data along with a single model record in my collection?

I would like to be able to assign a list of states to a record, it can be just 1 state or all of them. Certainly I can just do a comma-delimited list text field but that feels wrong. (however, if this is the ONLY way to do this, what then is the ideal way of filtering out to choose records with states the user selected to filter by? just loop over every single record and run a check on each?)

Basically if I were building it out normally in SQL Server, I would have a second table that stores the ID of my current item along with an ID of a state, and it would be a one-to-many join. Any way to accomplish this here?

(also, why does the Alloy documentation state that "date", "datetime", "tinyint", etc. are valid column types for SQLite? They all get changed to "text" when I run..)

Thanks!


Viewing all articles
Browse latest Browse all 8068

Trending Articles