Re: [Mojolicious] Legacy ? CRUD on an XML file within a webpage

2019-03-29 Thread Dominique Dumont
On Friday, 22 March 2019 16:16:52 CET Luc Larochelle wrote:
> I've been thinking a lot about this lately. In a very simple and light
> application, the database is an XML file , around 1000 entries and very low
> IO.
> 
> I haven't been orienting my work on XML, but I was wondering if it would be
> easier to CRUD on the XML directly instead of creating a web app + migrate
> the data to a db, etc ...
> 
> I wouldn't know where to start though, any hints ?

I've used XML::Twig to process XML data. 

This module can read, update parts of the XML data and write back to a file.

HTH




-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.


Re: [Mojolicious] Legacy ? CRUD on an XML file within a webpage

2019-03-22 Thread Luc Larochelle
Hi Stefan, it's similar but I don't even have to create views or join. The 
given XML is called by a backend script already equipped with functions to 
deal with the XML data. Actually it is really straight forward :)

So in short, the development can become complicated ?


On Friday, 22 March 2019 11:42:56 UTC-4, Stefan Adams wrote:
>
>
>
> On Fri, Mar 22, 2019 at 10:16 AM Luc Larochelle  > wrote:
>
>> I've been thinking a lot about this lately. In a very simple and light 
>> application, the database is an XML file , around 1000 entries and very low 
>> IO.
>>
>> I haven't been orienting my work on XML, but I was wondering if it would 
>> be easier to CRUD on the XML directly instead of creating a web app + 
>> migrate the data to a db, etc ...
>>
>
> It sounds like the problem that I have is similar to yours.  I'm dealing 
> with a SOAP-based web API that delivers 500 records at a time.  I'm trying 
> hard -- probably too hard, but I'm stubborn -- to avoid converting the XML 
> results into a database.  The schema necessary to map this web service is 
> 300 pages long, so no thanks.  Like you, I'm dealing with low IO and prefer 
> to handle my processing in-memory with Perl rather than crafting SQL 
> queries.  So, as I indicated in the thread you linked, I deserialize the 
> SOAP response into a complex Perl data structure and then I further shove 
> that into a Mojo::Collection so I can very easily chain methods for grep, 
> sort, map, each, etc.  I can also modify the data and then send it back to 
> the web service via SOAP.
>
> I'm getting very close to releasing Mojo::Autotask 
> 
>  to 
> CPAN, but there's the development branch to review if you like.  This also 
> uses Mojo::Redis for memoizing results.  The included 
> Mojo::Collection::Role::Autotask expand method is the equivalent of an SQL 
> 'join'.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.


Re: [Mojolicious] Legacy ? CRUD on an XML file within a webpage

2019-03-22 Thread Stefan Adams
On Fri, Mar 22, 2019 at 10:16 AM Luc Larochelle 
wrote:

> I've been thinking a lot about this lately. In a very simple and light
> application, the database is an XML file , around 1000 entries and very low
> IO.
>
> I haven't been orienting my work on XML, but I was wondering if it would
> be easier to CRUD on the XML directly instead of creating a web app +
> migrate the data to a db, etc ...
>

It sounds like the problem that I have is similar to yours.  I'm dealing
with a SOAP-based web API that delivers 500 records at a time.  I'm trying
hard -- probably too hard, but I'm stubborn -- to avoid converting the XML
results into a database.  The schema necessary to map this web service is
300 pages long, so no thanks.  Like you, I'm dealing with low IO and prefer
to handle my processing in-memory with Perl rather than crafting SQL
queries.  So, as I indicated in the thread you linked, I deserialize the
SOAP response into a complex Perl data structure and then I further shove
that into a Mojo::Collection so I can very easily chain methods for grep,
sort, map, each, etc.  I can also modify the data and then send it back to
the web service via SOAP.

I'm getting very close to releasing Mojo::Autotask

to
CPAN, but there's the development branch to review if you like.  This also
uses Mojo::Redis for memoizing results.  The included
Mojo::Collection::Role::Autotask expand method is the equivalent of an SQL
'join'.

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.


[Mojolicious] Legacy ? CRUD on an XML file within a webpage

2019-03-22 Thread Luc Larochelle
Hello everyone,

I've been thinking a lot about this lately. In a very simple and light 
application, the database is an XML file , around 1000 entries and very low 
IO.

I haven't been orienting my work on XML, but I was wondering if it would be 
easier to CRUD on the XML directly instead of creating a web app + migrate 
the data to a db, etc ...

I wouldn't know where to start though, any hints ?

Cheers !

Luc

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.