Btw, after you call erlydb:code_gen(), you can start calling the
generated functions in 'simple', e.g. simple:find_all(), assuming you
didn't restart the VM.
Yariv
On Wed, Jun 25, 2008 at 2:01 PM, Yariv Sadan <[EMAIL PROTECTED]> wrote:
> Right, the code is actually generated in memory and then compiled into
> a .beam file which is the loaded into the VM. You can tell
> erlydb:compile() to save the .beam file in a given directory using the
> '{outdir, Dir}' option. There's also an option to output the new file
> in source form but I don't remember exactly what it is. It should be
> in the smerl documentation.
>
> Yariv
>
> On Wed, Jun 25, 2008 at 1:01 PM, db <[EMAIL PROTECTED]> wrote:
>>
>> I created a module simple.erl in following folder
>> /home/db/project1/src/simple.erl and added the following content:
>>
>> -module(simple).
>> %-export([table/0]).
>> %table()-> simple.
>>
>> Then on erl shell I started the following:
>>
>> erlydb:start(mysql, [{hostname, "localhost"}, {username, "simple"},
>> {password, "simple"}, {database, "simple"}, {pool_size, 10}]).
>>
>> erlydb:code_gen(["/home/db/project1/src/simple.erl"],{mysql,
>> [{allow_unsafe_statements, true}]}, [debug_info]).
>>
>> After erlydb:code_gen, I don't see anything written to simple.erl.
>> Content of simple.erl is still:
>>
>> -module(simple).
>> %-export([table/0]).
>> %table()-> simple.
>>
>>
>>
>> On Jun 25, 2:53 am, "Yariv Sadan" <[EMAIL PROTECTED]> wrote:
>>> It seems like your module name doesn't match the table name. If you
>>> want the table name to be different from the module name, you need to
>>> add the following line to the module:
>>>
>>> table() -> TableName.
>>>
>>> Yariv
>>>
>>
>> >>
>>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"erlyweb" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---