|
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 |
|
|