Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Non-OO interface to mysql

Reply
Thread Tools

Non-OO interface to mysql

 
 
Lars Eighner
Guest
Posts: n/a
 
      12-20-2008
Just another in a series of periodic requests asking if anyone has run
across a non-OO interface to MySQL.

--
Lars Eighner <http://larseighner.com/> http://www.velocityreviews.com/forums/(E-Mail Removed)
Bush's third term begins Jan. 20th with an invocation by Rick Warren.
Obama: No hope; No change; More of the Same.
 
Reply With Quote
 
 
 
 
sln@netherlands.com
Guest
Posts: n/a
 
      12-20-2008
On Sat, 20 Dec 2008 21:55:46 +0000 (UTC), Lars Eighner <(E-Mail Removed)> wrote:

>Just another in a series of periodic requests asking if anyone has run
>across a non-OO interface to MySQL.


Are you looking for one?

sln
 
Reply With Quote
 
 
 
 
Tim Greer
Guest
Posts: n/a
 
      12-20-2008
Lars Eighner wrote:

> Just another in a series of periodic requests asking if anyone has run
> across a non-OO interface to MySQL.
>


I don't know of any off hand, but I'm assuming there could be something
out there, or you could write your own method. However, I don't see a
reason to seek such a thing out, just to avoid OO (so I assume there's
more to the question), and that could be a pretty big wheel to
reinvent, especially with all of the error checking, etc. Is there
more to the issue than that (being OO or not)? If so, you might get a
more suitable suggestion than just a non OO solution.
--
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting. 24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!
 
Reply With Quote
 
Lars Eighner
Guest
Posts: n/a
 
      12-21-2008
In our last episode,
<Itf3l.18820$(E-Mail Removed)>,
the lovely and talented Tim Greer
broadcast on comp.lang.perl.misc:

> Lars Eighner wrote:


>> Just another in a series of periodic requests asking if anyone has run
>> across a non-OO interface to MySQL.
>>


> I don't know of any off hand, but I'm assuming there could be something
> out there, or you could write your own method.


Err...no. The idea is to avoid methods.

> However, I don't see a reason to seek such a thing out, just to avoid OO
> (so I assume there's more to the question),


The idea is precisely to avoid OO (best) or at least to have function type
calls (second best).

The problem is PHP has function-type (or function looking) mysql interface,
but sucks for string and text manipulation in general. Perl has good text
and string manipulation, but has DBI objects (and even the Mysql.pm is now
really just an alias for the DBI objects, with method-type calls.

> and that could be a pretty big wheel to
> reinvent,


precisely why I keep hoping to find it has been done.

> especially with all of the error checking, etc. Is there more to the
> issue than that (being OO or not)?


Nope, that's it: avoiding OO so far as possible and OO type calls even if
OO behind the scenes cannot be avoided.

> If so, you might get a more suitable suggestion than just a non OO
> solution.



--
Lars Eighner <http://larseighner.com/> (E-Mail Removed)
Bush's third term begins Jan. 20th with an invocation by Rick Warren.
Obama: No hope; No change; More of the Same.
 
Reply With Quote
 
sln@netherlands.com
Guest
Posts: n/a
 
      12-21-2008
On Sat, 20 Dec 2008 21:55:46 +0000 (UTC), Lars Eighner <(E-Mail Removed)> wrote:

>Just another in a series of periodic requests asking if anyone has run
>across


I'm sure you could program somethin like ADO.
But It sounds like your interested in biting your nuts off.

sln
 
Reply With Quote
 
Lars Eighner
Guest
Posts: n/a
 
      12-21-2008
In our last episode,
<(E-Mail Removed)>,
the lovely and talented (E-Mail Removed)
broadcast on comp.lang.perl.misc:

> On Sat, 20 Dec 2008 21:55:46 +0000 (UTC), Lars Eighner <(E-Mail Removed)> wrote:


>>Just another in a series of periodic requests asking if anyone has run
>>across


> I'm sure you could program somethin like ADO.


Alternate Dimension Overhead?
Alien Dominated Orchids?
Anodized Dominican Organization?

What?

Surely the O could not stand for 'Object' since the idea is not to use
objects.


> But It sounds like your interested in biting your nuts off.


Whatever that means.

--
Lars Eighner <http://larseighner.com/> (E-Mail Removed)
Bush's third term begins Jan. 20th with an invocation by Rick Warren.
Obama: No hope; No change; More of the Same.
 
Reply With Quote
 
skeldoy
Guest
Posts: n/a
 
      12-21-2008
On Dec 20, 10:55*pm, Lars Eighner <(E-Mail Removed)> wrote:
> Just another in a series of periodic requests asking if anyone has run
> across a non-OO interface to MySQL.


You could always create a security nightmare/spaghetti-nest by
invoking the mysql-tool from backticks..
`mysql -u root database -e "select * from table;"` or something to
that accord.

Still. Not really sure why one would do such a thing. Gonna side with
the "biting of the nuts"-man there.
 
Reply With Quote
 
Lars Eighner
Guest
Posts: n/a
 
      12-21-2008
In our last episode,
<(E-Mail Removed)>, the
lovely and talented skeldoy broadcast on comp.lang.perl.misc:

> On Dec 20, 10:55*pm, Lars Eighner <(E-Mail Removed)> wrote:
>> Just another in a series of periodic requests asking if anyone has run
>> across a non-OO interface to MySQL.


> You could always create a security nightmare/spaghetti-nest by
> invoking the mysql-tool from backticks..
> `mysql -u root database -e "select * from table;"` or something to
> that accord.


Well, yes, that's how I will go if I have to build it myself. What I asking
is if the functions for parsing the return already exist somewhere.


> Still. Not really sure why one would do such a thing. Gonna side with
> the "biting of the nuts"-man there.

--
Lars Eighner <http://larseighner.com/> (E-Mail Removed)
Bush's third term begins Jan. 20th with an invocation by Rick Warren.
Obama: No hope; No change; More of the Same.
 
Reply With Quote
 
Peter J. Holzer
Guest
Posts: n/a
 
      12-21-2008
On 2008-12-21 16:03, Lars Eighner <(E-Mail Removed)> wrote:
> In our last episode,
><(E-Mail Removed)>, the
> lovely and talented skeldoy broadcast on comp.lang.perl.misc:
>> On Dec 20, 10:55*pm, Lars Eighner <(E-Mail Removed)> wrote:
>>> Just another in a series of periodic requests asking if anyone has run
>>> across a non-OO interface to MySQL.

>
>> You could always create a security nightmare/spaghetti-nest by
>> invoking the mysql-tool from backticks..
>> `mysql -u root database -e "select * from table;"` or something to
>> that accord.

>
> Well, yes, that's how I will go if I have to build it myself. What I asking
> is if the functions for parsing the return already exist somewhere.


Oh my god. That's really the worst way to implement it.

Write simple wrapping functions around DBI, if you prefer to write
$rows = mysql_selectall_arrayref($dbh, "select * from table");
instead of
$rows = $dbh->selectall_arrayref("select * from table");

Or write wrapper functions around the C API if you prefer writing XS to
writing Perl (but then, why would you write in Perl in the first case?).

But parsing the output of mysql is just plainly insane.

hp

 
Reply With Quote
 
Peter J. Holzer
Guest
Posts: n/a
 
      12-21-2008
On 2008-12-21 22:12, Keith Keller <(E-Mail Removed)-francisco.ca.us> wrote:
> On 2008-12-21, Lars Eighner <(E-Mail Removed)> wrote:
>> Nope, that's it: avoiding OO so far as possible and OO type calls even if
>> OO behind the scenes cannot be avoided.

>
> As someone else posted, you could simply write your own function-style
> wrappers around the DBI methods. Compared to basically rewriting DBI in
> a functional style from scratch,


Rewriting DBI in a functional style might be interesting (SQL already
has some properties of functional languages). But Lars doesn't strike me
as a Lisp or Haskell fan.

hp
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How to insert PDF file in to MySql and read it from MySql toJAVA App Jeffrey H. Coffield Java 1 07-24-2009 12:29 AM
MySQL-python-1.2.2 install with no mysql washakie Python 4 01-15-2008 08:15 PM
"mysql.h: No such file or directory" when building MySQL-python francescomoi@europe.com Python 2 05-11-2005 03:12 PM
DBD:mysql doesn't read mysql option file /etc/my.cnf file JL Perl 0 01-28-2005 03:19 AM
"Pure Python" MySQL module like Net::MySQL Ravi Python 6 07-21-2003 06:53 PM



Advertisments