Marky::DbTable - Marky::DbTable - querying one database table
version 0.035
use Marky::DbTable;;
Bookmarking and Tutorial Library application. Querying one database table, returning result.
Marky::DbTable - querying one database table
Create a new object, setting global values for the object.
my $obj = Marky::DbTable->new( database=>$database);
Query the database, return an array of results.
$results = $dbtable->query_raw($sql);
Query the database, return results and query-tags.
$results = $dbtable->query( location=>$base_url, %args);
Query the database, return a taglist
Query the database, return a tagcloud.
Query the database, return the total number of records.
There was an error, what was it?
These are functions which are NOT exported by this plugin.
Set the defaults for the object if they are not defined already.
Connect to the database If we've already connected, do nothing.
Search the database; returns the total, the query, and the results for the current page.
$hashref = $dbtable->_search( q=>$query_string, tags=>$tags, p=>$p, n=>$items_per_page, sort_by=>$order_by, );
Process the request, return HTML Note that if there are no query-strings, it will return ALL the results. It's so annoying to have a search-engine which barfs at empty searches.
$dbtable->_process_request(%args);
Process the request, return HTML of all the tags.
$dbtable->_process_taglist(%args);
$dbtable->_process_tagcloud(%args);
Find the total records in the database.
$dbtable->_total_records();
Build (part of) a WHERE condition
$where_cond = $dbtable->build_where( q=>$query_string, field=>$field_name, );
Convert a query string to an SQL select statement While this leverages on Select::Query, it does its own thing for a generic query and for a tags query
$sql = $dbtable->_query_to_sql( q=>$query_string, tags=>$tags, p=>$p, where=>$where, n=>$items_per_page, sort_by=>$order_by, sort_by2=>$order_by2, sort_by3=>$order_by3, );
Format an array of results hashrefs into HTML
$result = $self->_format_searchform( total=>$total, tags_query=>$tags_query, location=>$action_url);
Format the prev/next links.
$result = $self->_format_pagination( total=>$total, tags_query=>$tags_query, location=>$action_url);
$result = $self->_format_rows( rows=>$result_arrayref, total=>$total, tags_query=>$tags_query, tags_action=>$action_url);
Count up all the tags in the results.
%all_tags = $self->_create_taglist( rows=>$result_arrayref);
Format a hash of tags into HTML
$tagcloud = $dbtable->_format_tagcloud( all_tags=>\%all_tags, tags_query=>$tags_query, tags_action=>$action_url);
$taglist = $dbtable->_format_taglist( all_tags=>\%all_tags, tags_query=>$tags_query, tags_action=>$action_url);
Format an array of tags into HTML
$taglist = $dbtable->_format_tag_collection( in_list=>0, all_tags=>\%all_tags, tags_array=>\@tags, tags_query=>$tags_query, tags_action=>$action_url);
Format a tag query into components which can be removed from the query
$tagq_str = $dbtable->_format_tag_query( tags_query=>$tags_query, tags_action=>$action_url);
Format a q query into components which can be removed from the query
$tagq_str = $dbtable->_format_q_query( q=>$q, tags_query=>$tags_query, action=>$action_url);
Kathryn Andersen <perlkat@katspace.org>
This software is copyright (c) 2017 by Kathryn Andersen.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Marky, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Marky
CPAN shell
perl -MCPAN -e shell install Marky
For more information on module installation, please visit the detailed CPAN module installation guide.