-
Notifications
You must be signed in to change notification settings - Fork 68
save to disk
jschoch edited this page Jul 9, 2013
·
2 revisions
Start a new IEX shell like so
iex --sname dsktest -S mix
paste the following in
Amnesia.Schema.create
Amnesia.start
Database.create( disk: [node])
Database.wait
use Amnesia
use Database
Amnesia.transaction! do
user = User[id: 24]
user.add_message("yo dawg i'm on disk")
user.write
end
Amnesia.stop
exit iex, and start it back up again. Paste the following
Amnesia.start
use Amnesia
use Database
u = User.read!(24)
u.messages!
the result you want is:
iex(dsktest@ip-10-40-65-192)7> u.messages!
[Database.Message[user_id: 24, content: "yo dawg i'm on disk"]]