tags:

views:

151

answers:

5

Hi, Do you know a database written purely in Perl with DBI interface? Or what can be used if there is no MySql or Postgresql installed and I want to use Perl only?

Thank you.

Ok, I just wanted something that can be used with Catalyst.

+15  A: 

What about SQLite?

Frank Heikens
SQLite is written in C.
Rob Wells
I voted this answer up, but SQLite answers the second part of the question, but not the first part. The question asked for a *database* written in Perl. SQLite is implemented in C. I'm assuming that the poster wants something pure-perl that can be deployed without any dependencies, like Apache Derby for Java (http://db.apache.org/derby/)
Chris Dolan
There are two questions there. The first is about a database written in Perl. The second is more general. Frank's answer works for the second just fine.
JUST MY correct OPINION
short of clarification, I'd guess the zero-installation is more important and this is the answer being looked for.
ysth
DBD::SQLite doesn't have any Non-Perl external dependencies. It includes the C source with it.
Chas. Owens
+8  A: 

That depends greatly on what you consider "database".

If you just want something to store your data, there's a number of Perl databases avialable. Some are listed here: http://www.perl.com/pub/a/2004/09/12/embedded.html

  • Tie::File

  • Berkley DB

  • SQLite

    Please note that despite "SQLite is written in C" comments I saw here, the article explicitly states:

    Conveniently, the DBI-driver for SQLite, DBD::SQLite, already contains the database engine itself as part of the module - so installing this module is all that is required to be able to use SQLite from Perl.

However, NONE of the above is a real database engine, supporting transactions etc..., although some allow SQL-like query language access

I'm not aware of any real database engines implemented in Perl.

DVK
I found one but it does not have DBI interface.
Aftershock
SQLite does support transactions, http://sqlite.org/features.html
Hasturkun
@Aftershock: please edit your question to be more specific about what you need and what your limitations are. Currently everyone is just trying to guess, which doesn't help anyone. :)
Ether
Well, I just wanted to discover my options. I consider to use Catalyst and it need a database as far as I know. I guess it may help others who look for a pure Perl database.
Aftershock
Aftershock: With all due respect, I don't think you actually want a pure-Perl database. Any non-trivial query would be dog-slow. DBs are one of the few things where you really need the performance.
tsee
+2  A: 

Perl rule 34:

If you can imagine it, there's a DBD module for it ;)

http://search.cpan.org/search?m=module&q=DBD::&s=1

SchlaWiener
+10  A: 

I believe DBD::CSV is a simple DBD implementation that uses Text::CSV to persist data to CSV files.

araqnid
By the way, this look good.
Aftershock
+1  A: 

AFAIK there is no database in pure perl that is relational, it's not really economical; you might look in ACME on CPAN.

Essentially you have two choices: a pure perl module that provides a DBD package that wraps around, for example .txt, .csv, or .xml files.

If there is none, you could also implement a BDB/DBM style system of your own using pure perl, much like Ken Thompson did in C with DBM. It however, wouldn't be as complex as having SQL based relational database.

If you expect to use SQL, use an SQL based database.

TerryP