Randy Stauner > DBIx-RoboQuery > DBIx::RoboQuery::Util

Download:
DBIx-RoboQuery-0.032.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 0.032   Source  

NAME ^

DBIx::RoboQuery::Util - Utility functions for DBIx::RoboQuery

VERSION ^

version 0.032

SYNOPSIS ^

  use DBIx::RoboQuery::Util ();

DESCRIPTION ^

A collection of utility functions for DBIx::RoboQuery.

FUNCTIONS ^

order_from_sql

  # returns qw(fld1)
  @order = order_from_sql("SELECT * FROM table ORDER BY fld1");

  # returns qw(fld1 fld2)
  @order = order_from_sql(
    "SELECT * FROM table ORDER BY fld1 DESC, fld2 FETCH 2 ROWS",
    {suffix => 'FETCH 2 ROWS'}
  );
    # suffix can also be an re: qr/FETCH \d+ ROWS/

Return a list of the column names that make up the sort order based on the ORDER BY clause of a SQL statement.

Options can be specified in a hashref:

Other modules that could be used instead:

Currently a flat list of column names is returned. (Any direction (ASC or DESC) is dropped.)

EXPORTS ^

None. The functions in this module are not intended for public consumption.

AUTHOR ^

Randy Stauner <rwstauner@cpan.org>

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2010 by Randy Stauner.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

syntax highlighting: