Erlang Mailing Lists

Author Message

<  Erlyweb mailing list  ~  ErlyDB without ErlyWeb problem with reversed params

Guest
Posted: Wed Jan 09, 2008 12:48 pm Reply with quote
Guest
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.

Guest
Posted: Thu Jan 10, 2008 8:31 am Reply with quote
Guest
I haven't actually ran this test code in a while so it could be
broken. What DBMS are you using?

Btw, it should be quite easy to use ErlyDB without ErlyWeb. Just call
erlydb:start() followed by erlydb:code_gen().

Yariv

On Jan 9, 2008 4:47 AM, Jake Morrison <jake.morrison@gmail.com> wrote:
> 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)
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist
Guest
Posted: Thu Jan 10, 2008 9:56 am Reply with quote
Guest
Hi Yariv,

On Jan 10, 4:19 pm, "Yariv Sadan" <yarivsa...@gmail.com> wrote:
> I haven't actually ran this test code in a while so it could be
> broken. What DBMS are you using?

The same error occurs with both MySQL and PostgreSQL. The error
message that I posted came from MySQL. I plan
to use it with PostgreSQL, though.

> Btw, it should be quite easy to use ErlyDB without ErlyWeb. Just call
> erlydb:start() followed by erlydb:code_gen().

I am just getting started, so I figured I would start by running the
tests.

Is there a complete example somewhere that I could start with
instead?

> Yariv

Thanks,
Jake

> On Jan 9, 2008 4:47 AM, Jake Morrison <jake.morri...@gmail.com> wrote:
>
> > 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)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist

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