Jake Morrison
unread,Jan 9, 2008, 7:47:15 AM1/9/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to erl...@googlegroups.com
Hi,
I am trying to get erlydb running outside of erlyweb. So I tried to run the
test/erlydb/erlydb_test.erl program. It's not working, though. I had to
swap around the parameters on the code_gen call. So it obviously hasn't
been run since things changed in 0.7.
After that change, it runs for a while, but fails later on. Something is
going wrong with the code gen, I guess, as the order of the parameters
is not matching up in the generated SQL.
before save: {developer,true,undefined,<<"Joe Armstrong">>,<<"Sweden">>}
mysql_conn:426: fetch <<"BEGIN">> (id <0.41.0>)
mysql_conn:426: fetch <<"INSERT INTO person(type,name,country) VALUES
('developer','Sweden','Joe Armstrong')">> (id <0.41.0>)
mysql_conn:426: fetch <<"SELECT last_insert_id()">> (id <0.41.0>)
mysql_conn:426: fetch <<"COMMIT">> (id <
0.41.0>)
So a 'developer' is getting created like
developer:new(<<"Joe Armstrong">>, <<"Sweden">>)
But when it is inserted into the table, the name and country are reversed.
The fields() are defined in developer.erl as [name, country].
Any ideas what's going wrong?
Thanks,
Jake (Reach on freenode)