Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^4: Perl Contempt in My Workplace

by marto (Cardinal)
on May 05, 2021 at 13:59 UTC ( [id://11132073]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Perl Contempt in My Workplace
in thread Perl Contempt in My Workplace

"who will fill the gaps on missing modules"

Various 'Datatables' modules exist on cpan, you didn't say which ones you tried and how they failed. Luckily, you don't need a perl module to return the data required for datatables, as has been made clear to you, the perl core modules achieve this without issue.

Replies are listed 'Best First'.
Re^5: Perl Contempt in My Workplace
by vkon (Curate) on May 05, 2021 at 16:26 UTC
    this is what I've tried
    use strict; use DBI; use DataTables; my $dbfile = 'base.db'; my $dbh = DBI->connect("dbi:SQLite:dbname=$dbfile","",""); my $dt = DataTables->new(dbh => $dbh); #set table to select from $dt->tables(["t"]); #set columns to select in same order as order of columns on page $dt->columns(["LPAR", "UCODE", "BOX", "Serial Number", "Box Name", "TE +ST", "N_OF_TEST", "N_OF_ERR"]); use Mojolicious::Lite; #print json back to browser get '/data-source' => sub { my $c = shift; $dt->print_json; }; app->start;
    Ok, now I've remembered on what's missing here.
    I need to work with database of 10_000_000+ records, those do not fit just JSON.

    I see that this module recently updated... How can I trust version 0.08? Author makes it clear that the module far from robust?

      DataTables doc makes clear that for a set that large you need to use server-side processing. This involves passing query params to a listening program on the server, for paging, filtering etc. It may be possible to write a plugin for a web framework providing the ajax routes, but there'd be so much config based on the individual application that it's difficult for me to see how to abstract enough to make it useful.


      The way forward always starts with a minimal test.
        I understand that.
        can you point me to perl solution to the problem? I need excel-like sorting and filtering - please show me and I will switch to it immediately

      "I need to work with database of 10_000_000+ records, those do not fit just JSON."

      Again, this has nothing to do with perl. The DataTables (JavaScript library, not Perl module) is very clear that you're doing it wrong, you can't have read the documentation for the tool you've decided to use. Server Side Processing. This would be the case regardless of what language you choose. You could or add clauses to your search query and/or page results, neither of which you've done. I don't use this module at all, and just return JSON data as explained earlier.

      "How can I trust version 0.08? Author makes it clear that the module far from robust?"

      Where does the author make it clear that is it 'far from robust'? How do you trust any other module or code you pull down regardless of language? Again, no perl/cpan issue here.

        given that I am doing it wrong - can you suggest the right way?

        what CPAN module should I use for the "server-side processing"?

        regarding 0.08 - I treat "0.0x" versions as "experimental" - the released version should be at least 1.0+ - am I wrong again with this assumption?

          A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11132073]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-04-25 12:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found