Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Why Perl Mongers don't play with mySQL (Read 2699 times)
Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 1759
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Re: Why Perl Mongers don't play with mySQL
Reply #8 - Sep 15th, 2015 at 2:22pm
Print Post  
Yup. But on the SQL side - After I have my other major 'fed by flatfile' site updated and converted to SQL (but not PHP), I'll start working on converting YaBB to DB with well optimized queries. (But it won't be this month or possibly next - the site I'm working on is HUGE and I'm learning how to optimize the queries and processes as I go.)

Note to everybody: We've already determined that we will not repeat the mistakes of 3.0. Once a YaBB install is converted to DB, it won't be backwards convertable from within YaBB. BUT, once it's done, we should be able to create converters to import data from other forum programs.

Now if somebody has time and the inclination, we still don't have a Mobile template.  Undecided
  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Red Barchetta
New Member
*
Offline



Posts: 46
Location: Miami, FL. USA
Joined: Oct 4th, 2014
Gender: Male
Re: Why Perl Mongers don't play with mySQL
Reply #7 - Sep 15th, 2015 at 3:25am
Print Post  
Playing with the Anon posting huh?   Smiley
  

Florida Classics and Muscle Car Automotive Forum Administrator
Back to top
WWW  
IP Logged
 
Anon
Guest


Re: Why Perl Mongers don't play with mySQL
Reply #6 - Sep 13th, 2015 at 11:17pm
Print Post  
Guest test
  
Back to top
 
IP Logged
 
Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 1759
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Re: Why Perl Mongers don't play with mySQL
Reply #5 - Aug 24th, 2015 at 4:40pm
Print Post  
Since I'm playing with converting a lot of my personal stuff to Perl/mySQL I'm taking mental notes on how to start configuring YaBB databases. 

That's probably going to be the hardest part - getting the current data configured to take advantage of SQL strengths - picking out only what you need for a specific screen or action. Like for the message display - instead of loading the entire user file into a hash, just load what the page actually needs.

So I figure we'll be looking at how PHP forums configure their data and pick out what makes sense for YaBB's data
  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
pyragony54
God Member
*****
Offline


I Love YaBB!

Posts: 664
Location: Йошкар-Ола
Joined: May 25th, 2014
Gender: Male
Re: Why Perl Mongers don't play with mySQL
Reply #4 - Aug 24th, 2015 at 3:42pm
Print Post  
Here are a.
Looks pretty good.


Code (Perl)
Select All
use DBI;
# connect to database

$db = DBI->connect("DBI:mysql:mysql");

exit;
sub get_boards{
$query = dbquery("SELECT * FROM boards");
}

# preps and execs mysql queries..
sub dbquery {
  $dbqueries++;
  my $q;
  $q = $db->prepare(shift);
  $q->execute();
  return $q;
}

sub package_boards{
while (my $row = $query->fetchrow_hashref) {
  my %boarddata;
  for my $key (keys %$row) {
    $boarddata{$key} = $row->{$key};
  }
  @boards[$boarddata{board_id}] = \%boarddata;
}
}
sub get_cats{
$query = dbquery("SELECT * FROM categories ORDER BY priority DESC");
}
sub pack_n_print_cats{
my %outboards;
while (my $catdata = $query->fetchrow_hashref) {

  undef %outboards;
  # category header
  $template->setvar('cat_id', $catdata->{category_id});
  $template->setvar('cat_name', $catdata->{name});
  $template->pparse('boardindex/category_top.html');

  # figure out what boards in current category...

  foreach my $board (@boards) {
    if ($board->{category_id} == $catdata->{category_id}) {
      $outboards{$board->{priority}} = $board->{board_id};

    }

  }
  foreach my $key (reverse sort keys %outboards) {
    my $board = @boards[$outboards{$key}];         #you has it as @boards[$out....i dunno?
    $template->setvar('board_id', $board->{board_id});
    $template->setvar('board_name', $board->{name});
    $template->setvar('board_desc', $board->{description});
    $template->setvar('board_topics', $board->{topics});
    $template->setvar('board_replies', $board->{replies});
    $template->setvar('board_lastpost_id', $board->{lastpost_id});
    $template->setvar('board_lastpost_author', $board->{lastpost_author});
    $template->setvar('board_lastpost_title', $board->{lastpost_title});
    $template->setvar('board_lastpost_time', $board->{lastpost_time});
    $template->pparse('boardindex/board.html');
  }
  # category footer
  $template->pparse('boardindex/category_bottom.html');
}
}
1;
 

  

Build190.zip (Attachment deleted | 59 Downloads )

Bad manners keep people but the only reason for a kind of privilege, because no skin them on the mouth.
Back to top
 
IP Logged
 
pyragony54
God Member
*****
Offline


I Love YaBB!

Posts: 664
Location: Йошкар-Ола
Joined: May 25th, 2014
Gender: Male
Re: Why Perl Mongers don't play with mySQL
Reply #3 - Aug 24th, 2015 at 3:31pm
Print Post  
I once wanted a little. Unfortunately, there is virtually no Forum Software in PERL. One thing I have found, however, and once downloaded. According to the description, it is to have a database. Look easy at times. Maybe that helps further.

http://netbula.com/anyboard/
  

anyboard_free.zip (Attachment deleted | 62 Downloads )

Bad manners keep people but the only reason for a kind of privilege, because no skin them on the mouth.
Back to top
 
IP Logged
 
Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 1759
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Re: Why Perl Mongers don't play with mySQL
Reply #2 - Aug 24th, 2015 at 2:07pm
Print Post  
The DBI module actually works fine for Perl (I just converted one of my clients to storing almost all their membership and searchable data in mySQL - the actual conversion was a pain and a half but now that it's done the data can be accessed via Perl and PHP.)

The problem - as I see it - is that mySQL has been 'married' to PHP for so long that in order to find the instructions for how to do anything you have to wade through 'how to make a form in PHP'. And that's pretty off-putting for Perl mongers who are trying to figure out how to update an entry in an SQL table (without opening phpMyAdmin) when they can write the equivalent for a flat-file in their sleep.  Roll Eyes

There are a few places on the 'net with Perl/SQL tutorials that are pretty good.

  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
pyragony54
God Member
*****
Offline


I Love YaBB!

Posts: 664
Location: Йошкар-Ола
Joined: May 25th, 2014
Gender: Male
Re: Why Perl Mongers don't play with mySQL
Reply #1 - Aug 24th, 2015 at 1:35pm
Print Post  
Maybe I understand now what's wrong. Maybe help you finished modules.

http://search.cpan.org/search?query=SQL&mode=all
  

Bad manners keep people but the only reason for a kind of privilege, because no skin them on the mouth.
Back to top
 
IP Logged
 
Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 1759
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Why Perl Mongers don't play with mySQL
Aug 14th, 2015 at 2:05pm
Print Post  
  • Old habits of creating flat files are hard to break and Perl's functional limit on the size stored things is based on memory and server capacity, not a 64 KB text field content max.
  • Flat files are extremely portable.
  • The documentation on the Perl side is abysmal.
    • Most Perl programming books appear to either ignore using databases or have a tiny section that says 'Oh, yeah, you can these Perl modules to access database systems'
    • The last book (that I can find) dedicated to using mySQL and Perl (not PHP) was published in 2001 and assumes you can't build a form without using CGI.pm.  There's a new book out in December that looks promising - but it won't be available until December.  Angry  
    • MySQL books (without PHP) are a little better - they might have a whole section on getting Perl to talk to a database.  Roll Eyes
  • Did I mention: The documentation on the Perl side is abysmal?!!


AACK!  Smiley

(This rant brought to you courtesy of a client who hired a graphics/CMS designer and a new CMS system that can't handle data stored in the cgi-bin.)
« Last Edit: Aug 8th, 2016 at 4:18pm by Dandello »  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint