siuying / NanoStoreInMotion

RubyMotion wrapper for NanoStore, a lightweight schema-less key-value document database based on sqlite.
Other
103 stars 24 forks source link

where to define storage type #7

Closed raysrashmi closed 12 years ago

raysrashmi commented 12 years ago

Hi,

i am not sure where i have to define my storage type in my app??

could you please help me ?

thanks in advance

siuying commented 12 years ago

You may either set the default store:

NanoStore.shared_store = NanoStore.store(:memory) # memory only db

Or set store in a per model basis:

class User < NanoStore::Model
  attribute :name
  attribute :age
  attribute :created_at
end
User.store = NanoStore.store(:memory) # memory only db