Erlang/OTP Forums

Author Message

<  Erlyweb mailing list  ~  erlydb_mnesia patch for get_metadata

Guest
Posted: Wed Dec 03, 2008 5:30 pm Reply with quote
Guest
Hi.
erlydb_mnesia:get_metadata current code throws an error.
Please review and apply the following patch.
thanks, michael.
======

diff --git a/src/erlydb/erlydb_mnesia.erl b/src/erlydb/
erlydb_mnesia.erl
index bd7a136..54a66bb 100644
--- a/src/erlydb/erlydb_mnesia.erl
+++ b/src/erlydb/erlydb_mnesia.erl
@@ -184,11 +184,10 @@ start(_Options) ->
get_metadata(_Options) ->
% NOTE Integration with mnesia_rdbms would be interesting...
Tables = mnesia:system_info(tables) -- [schema],
- Tree = lists:foldl(
- fun(Table, TablesTree) ->
- gb_trees:enter(Table, get_metadata(Table, table_fields
(Table)), TablesTree)
- end, gb_trees:empty(), Tables),
- {ok, Tree}.
+ lists:foldl(
+ fun(Table, TablesTree) ->
+ gb_trees:enter(Table, get_metadata(Table, table_fields
(Table)), TablesTree)
+ end, gb_trees:empty(), Tables).

get_metadata(Table, Fields) when is_list(Fields) ->
[get_metadata(Table, Field) || Field <- Fields];
@@ -356,6 +355,7 @@ select(Modifier, Fields, Tables, WhereExpr,
Extras, Options, QHDesc) ->
end,
QLC1 = QLC ++ " || " ++ comma(Desc#qhdesc.generators ++ lists:reverse
(Desc#qhdesc.filters)) ++ "].",
?L(["About to execute QLC: ", QLC1]),
+ ?L(["With bindings : ", Desc#qhdesc.bindings]),
{atomic, Results} = transaction(
fun() ->
QHOptions = Desc#qhdesc.options,

--~--~---------~--~----~------------~-------~--~----~
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 received from mailinglist
Guest
Posted: Thu Dec 04, 2008 11:01 pm Reply with quote
Guest
+1.

I'd like to see this fix included, please.

-jw

On Dec 4, 2008, at 2:29 AM, Michael Mullis wrote:

>
> Hi.
> erlydb_mnesia:get_metadata current code throws an error.
> Please review and apply the following patch.
> thanks, michael.
> ======
>
> diff --git a/src/erlydb/erlydb_mnesia.erl b/src/erlydb/
> erlydb_mnesia.erl
> index bd7a136..54a66bb 100644
> --- a/src/erlydb/erlydb_mnesia.erl
> +++ b/src/erlydb/erlydb_mnesia.erl
> @@ -184,11 +184,10 @@ start(_Options) ->
> get_metadata(_Options) ->
> % NOTE Integration with mnesia_rdbms would be interesting...
> Tables = mnesia:system_info(tables) -- [schema],
> - Tree = lists:foldl(
> - fun(Table, TablesTree) ->
> - gb_trees:enter(Table, get_metadata(Table, table_fields
> (Table)), TablesTree)
> - end, gb_trees:empty(), Tables),
> - {ok, Tree}.
> + lists:foldl(
> + fun(Table, TablesTree) ->
> + gb_trees:enter(Table, get_metadata(Table, table_fields
> (Table)), TablesTree)
> + end, gb_trees:empty(), Tables).
>
> get_metadata(Table, Fields) when is_list(Fields) ->
> [get_metadata(Table, Field) || Field <- Fields];
> @@ -356,6 +355,7 @@ select(Modifier, Fields, Tables, WhereExpr,
> Extras, Options, QHDesc) ->
> end,
> QLC1 = QLC ++ " || " ++ comma(Desc#qhdesc.generators ++ lists:reverse
> (Desc#qhdesc.filters)) ++ "].",
> ?L(["About to execute QLC: ", QLC1]),
> + ?L(["With bindings : ", Desc#qhdesc.bindings]),
> {atomic, Results} = transaction(
> fun() ->
> QHOptions = Desc#qhdesc.options,
>
> >


--~--~---------~--~----~------------~-------~--~----~
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 received from mailinglist
Guest
Posted: Tue Dec 09, 2008 3:49 am Reply with quote
Guest
will do

On Thu, Dec 4, 2008 at 2:55 PM, John Webb <jwebb@gol.com> wrote:
>
> +1.
>
> I'd like to see this fix included, please.
>
> -jw
>
> On Dec 4, 2008, at 2:29 AM, Michael Mullis wrote:
>
>>
>> Hi.
>> erlydb_mnesia:get_metadata current code throws an error.
>> Please review and apply the following patch.
>> thanks, michael.
>> ======
>>
>> diff --git a/src/erlydb/erlydb_mnesia.erl b/src/erlydb/
>> erlydb_mnesia.erl
>> index bd7a136..54a66bb 100644
>> --- a/src/erlydb/erlydb_mnesia.erl
>> +++ b/src/erlydb/erlydb_mnesia.erl
>> @@ -184,11 +184,10 @@ start(_Options) ->
>> get_metadata(_Options) ->
>> % NOTE Integration with mnesia_rdbms would be interesting...
>> Tables = mnesia:system_info(tables) -- [schema],
>> - Tree = lists:foldl(
>> - fun(Table, TablesTree) ->
>> - gb_trees:enter(Table, get_metadata(Table, table_fields
>> (Table)), TablesTree)
>> - end, gb_trees:empty(), Tables),
>> - {ok, Tree}.
>> + lists:foldl(
>> + fun(Table, TablesTree) ->
>> + gb_trees:enter(Table, get_metadata(Table, table_fields
>> (Table)), TablesTree)
>> + end, gb_trees:empty(), Tables).
>>
>> get_metadata(Table, Fields) when is_list(Fields) ->
>> [get_metadata(Table, Field) || Field <- Fields];
>> @@ -356,6 +355,7 @@ select(Modifier, Fields, Tables, WhereExpr,
>> Extras, Options, QHDesc) ->
>> end,
>> QLC1 = QLC ++ " || " ++ comma(Desc#qhdesc.generators ++ lists:reverse
>> (Desc#qhdesc.filters)) ++ "].",
>> ?L(["About to execute QLC: ", QLC1]),
>> + ?L(["With bindings : ", Desc#qhdesc.bindings]),
>> {atomic, Results} = transaction(
>> fun() ->
>> QHOptions = Desc#qhdesc.options,
>>
>> >
>
>
> >
>

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