Still looking for a function-type MySQL interface

Discussion in 'Perl Misc' started by Lars Eighner, Mar 10, 2010.

  1. Lars Eighner

    Lars Eighner Guest

    I'm still looking for a function-type database interface. CPAN returns more
    than 1100 hits for mysql, but if there is a function interface, I haven't
    found it.

    --
    Lars Eighner <http://larseighner.com/> Warbama's Afghaninam day: 98
    2357.9 hours since Warbama declared Viet Nam II.
    Warbama: An LBJ for the Twenty-First century. No hope. No change.
    Lars Eighner, Mar 10, 2010
    #1
    1. Advertising

  2. In article <>,
    Lars Eighner <> wrote:

    > I'm still looking for a function-type database interface. CPAN returns more
    > than 1100 hits for mysql, but if there is a function interface, I haven't
    > found it.


    There are lots of CPAN entries for database stuff. What have you found?

    --
    DeeDee, don't press that button! DeeDee! NO! Dee...
    [I filter all Goggle Groups posts, so any reply may be automatically ignored]
    Michael Vilain, Mar 10, 2010
    #2
    1. Advertising

  3. Lars Eighner

    Lars Eighner Guest

    In our last episode,
    <>,
    the lovely and talented Michael Vilain
    broadcast on comp.lang.perl.misc:

    > In article <>,
    > Lars Eighner <> wrote:


    >> I'm still looking for a function-type database interface. CPAN returns more
    >> than 1100 hits for mysql, but if there is a function interface, I haven't
    >> found it.


    > There are lots of CPAN entries for database stuff. What have you found?


    More than 1100 entries, but a many of the as I have inspected seem to
    involve minus greater-than notation. As I said, I am looking for a
    function-type database interface.

    --
    Lars Eighner <http://larseighner.com/> Warbama's Afghaninam day: 98
    2362.9 hours since Warbama declared Viet Nam II.
    Warbama: An LBJ for the Twenty-First century. No hope. No change.
    Lars Eighner, Mar 10, 2010
    #3
  4. Lars Eighner wrote:
    > Michael Vilain wrote:
    >> Lars Eighner wrote:

    >
    >>> I'm still looking for a function-type database interface. CPAN returns more
    >>> than 1100 hits for mysql, but if there is a function interface, I haven't
    >>> found it.

    >
    >> There are lots of CPAN entries for database stuff. What have you found?

    >
    > More than 1100 entries, but a many of the as I have inspected seem to
    > involve minus greater-than notation. As I said, I am looking for a
    > function-type database interface.
    >


    Ah, you want a *procedural* API rather than an *object-oriented* API.

    AFAIK DBI is object oriented and most (all?) Perl DBMS interfaces use DBI.

    What difficulties is the OO API causing you?

    --
    RGB
    RedGrittyBrick, Mar 10, 2010
    #4
  5. Lars Eighner

    Lars Eighner Guest

    In our last episode, <4b9796dd$0$2538$>, the lovely
    and talented RedGrittyBrick broadcast on comp.lang.perl.misc:

    > Lars Eighner wrote:
    >> Michael Vilain wrote:
    >>> Lars Eighner wrote:

    >>
    >>>> I'm still looking for a function-type database interface. CPAN returns more
    >>>> than 1100 hits for mysql, but if there is a function interface, I haven't
    >>>> found it.

    >>
    >>> There are lots of CPAN entries for database stuff. What have you found?

    >>
    >> More than 1100 entries, but a many of the as I have inspected seem to
    >> involve minus greater-than notation. As I said, I am looking for a
    >> function-type database interface.
    >>


    > Ah, you want a *procedural* API rather than an *object-oriented* API.


    > AFAIK DBI is object oriented and most (all?) Perl DBMS interfaces use DBI.


    > What difficulties is the OO API causing you?


    I can't read the notation as for example I can with the PHP mysql functions.

    Sure, I can copy an example with minus greater-than notation from a tutorial
    --- but in an hour, tomorrow, a week later, it's all greek to me. It isn't
    remotely perlish, which would be something like:

    opendb(MYDBHANDLE," gory details of db connection here");

    and so forth.

    --
    Lars Eighner <http://larseighner.com/> Warbama's Afghaninam day: 98
    2364.1 hours since Warbama declared Viet Nam II.
    Warbama: An LBJ for the Twenty-First century. No hope. No change.
    Lars Eighner, Mar 10, 2010
    #5
  6. On 10/03/2010 13:15, Lars Eighner wrote:
    > In our last episode,<4b9796dd$0$2538$>, the
    > lovely and talented RedGrittyBrick broadcast on comp.lang.perl.misc:
    >
    >> Lars Eighner wrote:
    >>> Michael Vilain wrote:
    >>>> Lars Eighner wrote:
    >>>
    >>>>> I'm still looking for a function-type database interface.
    >>>>> CPAN returns more than 1100 hits for mysql, but if there is a
    >>>>> function interface, I haven't found it.
    >>>
    >>>> There are lots of CPAN entries for database stuff. What have
    >>>> you found?
    >>>
    >>> More than 1100 entries, but a many of the as I have inspected
    >>> seem to involve minus greater-than notation. As I said, I am
    >>> looking for a function-type database interface.
    >>>

    >
    >> Ah, you want a *procedural* API rather than an *object-oriented*
    >> API.

    >
    >> AFAIK DBI is object oriented and most (all?) Perl DBMS interfaces
    >> use DBI.

    >
    >> What difficulties is the OO API causing you?

    >
    > I can't read the notation as for example I can with the PHP mysql
    > functions.


    Interestingly, when I Googled this subject, I encountered a note saying
    that the latest PHP API for MySQL is OO not procedural. I didn't read it
    carefully, but I got the impression that if you upgrade MySQL you'd have
    to switch to the OO API.

    I'm afraid the world is moving from procedural to OO. I may be wrong but
    I suspect module writers nowadays prefer to write OO APIs.


    > Sure, I can copy an example with minus greater-than notation from a
    > tutorial ---


    I recommend you try to think of a->b as an *arrow* notation. The object
    has a pointer to a subroutine, you use that pointer to call the
    subroutine (sloppy terminology for simplicity).


    > but in an hour, tomorrow, a week later, it's all greek
    > to me.


    I recommend you write yourself a few simple Perl OO toy programs. I
    found it a good way to get familiar with Perl OO paradigms. There are
    some good tutorials around and it only needs an hour or so if you have
    any prior exposure to OO concepts.

    perldoc perlboot; # http://perldoc.perl.org/perlboot.html
    perldoc perltoot; # http://perldoc.perl.org/perltoot.html


    > It isn't remotely perlish,


    It isn't Perl4ish but it is Perl5ish IMHO.


    > which would be something like:
    >
    > opendb(MYDBHANDLE," gory details of db connection here");
    >
    > and so forth.


    Maybe you could write a procedural wrapper for the OO API. Fill the
    wrapper with copious comments to yourself. You could centralise this
    into a procedural module. I've no idea how feasible this is for you (or
    anyone indeed), but it's an idea† you could consider.


    Sorry not to be of more help.

    --
    RGB
    † Probably a bad one :)
    RedGrittyBrick, Mar 10, 2010
    #6
  7. Lars Eighner

    Uri Guttman Guest

    >>>>> "LE" == Lars Eighner <> writes:

    >> There are lots of CPAN entries for database stuff. What have you found?


    LE> More than 1100 entries, but a many of the as I have inspected seem
    LE> to involve minus greater-than notation. As I said, I am looking
    LE> for a function-type database interface.

    why do you care about this? it isn't called 'minus greater-than
    notation' but OO. it is actually EASIER to use oo for this than
    procedural. and DBI is the standard interface to dozens of db systems so
    you can actually switch to another (if your sql is portable
    enough). your request makes little sense for that reason.

    and there is a module out there that will wrap an OO module into a
    procedural one (it assumes a default object for it). you can easily use
    it (i need to find it, i do think i know the author) or write your
    own. just allocate a singleton object in a lexical and all your
    procedural wrapper subs use it to make the OO calls. you save on passing
    the object and the dreaded -> notation but you lose on everything else.

    uri

    --
    Uri Guttman ------ -------- http://www.sysarch.com --
    ----- Perl Code Review , Architecture, Development, Training, Support ------
    --------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
    Uri Guttman, Mar 10, 2010
    #7
  8. Lars Eighner

    Dr.Ruud Guest

    Lars Eighner wrote:

    > More than 1100 entries, but a many of the as I have inspected seem to
    > involve minus greater-than notation. As I said, I am looking for a
    > function-type database interface.


    But why?

    It is easy to abstract away yourself though.

    Or see DBIx::perlish.

    --
    Ruud
    Dr.Ruud, Mar 10, 2010
    #8
  9. Lars Eighner

    Uri Guttman Guest

    >>>>> "LE" == Lars Eighner <> writes:

    LE> I'm still looking for a function-type database interface. CPAN
    LE> returns more than 1100 hits for mysql, but if there is a function
    LE> interface, I haven't found it.

    i still say learning OO perl is easy enough and you should learn
    it. saying pointy ops are hard is a barbie excuse. but if you MUST have
    a procedural API (functional is the wrong term), check out Sub::Exporter
    on cpan. it can create a procedural API from an OO one and manage a
    singleton object for you. you still need to do some work (if you can
    handle it) to create your own api. this a fool's errand you are on
    anyhow but i had to mention this module.

    uri

    --
    Uri Guttman ------ -------- http://www.sysarch.com --
    ----- Perl Code Review , Architecture, Development, Training, Support ------
    --------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
    Uri Guttman, Mar 15, 2010
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Robert Mark Bram
    Replies:
    0
    Views:
    3,920
    Robert Mark Bram
    Sep 28, 2003
  2. Harald Kirsch

    jython type coercion to interface type

    Harald Kirsch, Jun 25, 2003, in forum: Python
    Replies:
    1
    Views:
    1,701
    Harald Kirsch
    Jun 26, 2003
  3. duikboot
    Replies:
    0
    Views:
    283
    duikboot
    Jan 19, 2004
  4. ronrsr
    Replies:
    1
    Views:
    552
    Justin Ezequiel
    Feb 15, 2007
  5. Replies:
    7
    Views:
    299
Loading...

Share This Page