Is there any implementation of database by perl [closed]
Asked Answered
D

2

10

Is there any perl modules implementing function of database and easy to use. I do not need modules used to connect to some database products. I need simple database writing by perl.

Thanks.

Digitoxin answered 24/11, 2019 at 22:21 Comment(5)
If what you want is to store data in your hdd, you can use DBM::Deep, it is easy to manageBaeda
Does this module support query like SQL?Digitoxin
DBD::SQLite is a self-contained database management system fully compatible with the standard DBI module.Plangent
You might also like DBD::CSV which provides a standard SQL interface to CSV files.Hillier
You can use JSON, XML, YAMS formats to store data. Depending on chosen structure of the database you can implement utility functions. Otherwise you can look at DBM - metacpan.org/pod/DBD::DBM.Yovonnda
P
19

I would suggest using DBD::SQLite. This is a self-contained database management system with no dependency to external binaries (unlike most others DBI drivers). It has nice options such as creating in-memory databases.

SQLite is an open-source RDBMS that implements a significant subset of the SQL ANSI Standard.

DBD::SQLite is a legitimate DBI driver, so it conforms to the API of the great DBI module, which is the de-facto Perl standard interface for databases.

From the documentation:

DBD::SQLite is a Perl DBI driver for SQLite, that includes the entire thing in the distribution. So in order to get a fast transaction capable RDBMS working for your perl project you simply have to install this module, and nothing else.

Plangent answered 25/11, 2019 at 1:36 Comment(3)
"with no dependency to external binaries" -- well, you need the actual sqlite library itself (C). While that gets installed by the package, the Perl thing (DBD::SQLite) is just a driver. I second the suggestion, but it sure has a "dependency."Cribb
@Cribb it's not an external binary (it's linked in directly, not "installed" separately, and there's no server), and it's not a "dependency" in the sense of a prerequisite that you need to get beforehand or separately. So I think the answer gives a fair assessment.Dysgraphia
@Dysgraphia Dunno ... it's an independent general C library that the Perl bit interfaces. Even if the package bundles an sqlite version for convenience that is still a separate pop of C code, no-relation-to-Perl. This is mostly semantics, and I support the answer (and upvoted it), but to my mind this is exactly a Perl driver for an external library.Cribb
E
3

If you can live without SQL and relations, give DBM::Deep a try. Easiest of all, I wouldn't use it in production environment for sure, but it is ideal for rapid prototyping.

DESCRIPTION

A unique flat-file database module, written in pure perl. True multi-level hash/array support (unlike MLDBM, which is faked), hybrid OO / tie() interface, cross-platform FTPable files, ACID transactions, and is quite fast. Can handle millions of keys and unlimited levels without significant slow-down. Written from the ground-up in pure perl -- this is NOT a wrapper around a C-based DBM. Out-of-the-box compatibility with Unix, Mac OS X and Windows.

Elston answered 26/11, 2019 at 0:10 Comment(1)
I would take a tryDigitoxin

© 2022 - 2024 — McMap. All rights reserved.