Erlang Mailing Lists

Author Message

<  Erlyweb mailing list  ~  Mnesia Erlyweb issue

Ahmed
Posted: Mon Mar 03, 2008 11:59 pm Reply with quote
Joined: 03 Mar 2008 Posts: 8
Hi,

I have 2 questions about erlyweb:

1) I have the following record defined in my code:
-record(login, {username, password}).

I have defined a component called "login" using erlyweb:create_component(). I created a login info (i.e. username/password) and stored it in the database (mnesia in this case). However, login:find() returns a wrong record {login, false, "ahmed","test"} instead of {login, "ahmed","test"}. Also, login:find(WhereExpr) returns empty list. Am I doing something wrong and I'm not aware of it? Note that I didn't try this with MySQL yet, due to point #2.

You can find steps below.

1> mnesia:dirty_match_object({login, '_','_'}).
[{login,"ahmed","test"}]
2> login:find({username,'=',"ahmed"}).
erlydb_mnesia:205 ["In q with: ",
{select,'*',
{from,login},
{where,{username,'=',"ahmed"}},
undefined}]
erlydb_mnesia:358 ["About to execute QLC: ",
"[LOGIN || LOGIN <- mnesia:table(login), element(2, LOGIN) == Var44359]."]
erlydb_mnesia:368 ["Found Results: ",[]]
[]
3> login:find().
erlydb_mnesia:205 ["In q with: ",
{select,'*',{from,login},{where,undefined},undefined}]
[{login,false,"ahmed","test"}]
4>

2) When working with mysql, I cannot use erlydb with a user in localhost without a password. Is this a known bug? This is only for development so I'm not concerned a lot about security until it is time for deployment.

Best regards,

Ahmed Al-Issaei
View user's profile Send private message

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum