[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Berkeley DB or Store equivalent?

MK

5/17/2009 6:02:00 PM

I have never used mySQL because perl's Storable or BerkeleyDB modules
always did me fine for cgi stuff. I am going to be learning rails, so I
supposed I will have to learn mySQL anyway, but I was wondering: is it
exclusively web based, or could I use it to produce database files for
use in a (non web app) ruby script?

If not, is there a ruby equivalent to something nice and simple like
Storable?
--
Posted via http://www.ruby-....

15 Answers

MK

5/17/2009 6:16:00 PM

0

Is there no editing of posts on this forum!??! Tsk.

Looks like SQlite would be better...is there a ruby module for that
(guess I'll have to go google)?
--
Posted via http://www.ruby-....

MK

5/17/2009 6:22:00 PM

0

Mk 27 wrote:
> Is there no editing of posts on this forum!??! Tsk.
>
> Looks like SQlite would be better...is there a ruby module for that
> (guess I'll have to go google)?

Okay I see an SQlite::Database, and some associated SQlite/ruby doc that
says "this is not compatible w/ SQlite 3"...is that correct?
--
Posted via http://www.ruby-....

MK

5/17/2009 7:08:00 PM

0

> Okay I see an SQlite::Database, and some associated SQlite/ruby doc that
> says "this is not compatible w/ SQlite 3"...is that correct?

Found sqlite3-ruby in gems.
--
Posted via http://www.ruby-....

James Gray

5/17/2009 7:49:00 PM

0

On May 17, 2009, at 1:01 PM, Mk 27 wrote:

> I have never used mySQL because perl's Storable or BerkeleyDB modules
> always did me fine for cgi stuff. I am going to be learning rails,
> so I
> supposed I will have to learn mySQL anyway, but I was wondering: is it
> exclusively web based, or could I use it to produce database files for
> use in a (non web app) ruby script?

MySQL is not required for Rails. It works with SQLite, Postgres,
Oracle, and more.

> If not, is there a ruby equivalent to something nice and simple like
> Storable?

Yeah, Ruby's Marshal module is similar. If you would prefer a
BerkeleyDB like experience, check out Tokyo Cabinet.

James Edward Gray II


James Gray

5/17/2009 7:50:00 PM

0

On May 17, 2009, at 1:16 PM, Mk 27 wrote:

> Looks like SQlite would be better...is there a ruby module for that
> (guess I'll have to go google)?

Multiple libraries, yes. I recommend Amalgalite.

James Edward Gray II


MK

5/17/2009 7:55:00 PM

0

James Gray wrote:

>> If not, is there a ruby equivalent to something nice and simple like
>> Storable?
>
> Yeah, Ruby's Marshal module is similar. If you would prefer a
> BerkeleyDB like experience, check out Tokyo Cabinet.
>
> James Edward Gray II

I actually didn't understand what "SQL" referred to until today (a
specification). That makes it seem a lot more awkward than just saving
a data structure, but I guess I may as well start learning now.

But thanks for "Marshal", that will probably come in handy. Along the
same lines, is there anything like Data::Dumper (or YAML::XS::Dump)?
--
Posted via http://www.ruby-....

James Gray

5/17/2009 8:17:00 PM

0

On May 17, 2009, at 2:55 PM, Mk 27 wrote:

> But thanks for "Marshal", that will probably come in handy. Along the
> same lines, is there anything like Data::Dumper (or YAML::XS::Dump)?

Ruby ships with YAML, yes.

James Edward Gray II


Justin Collins

5/17/2009 8:37:00 PM

0

Mk 27 wrote:
> I have never used mySQL because perl's Storable or BerkeleyDB modules
> always did me fine for cgi stuff. I am going to be learning rails, so I
> supposed I will have to learn mySQL anyway, but I was wondering: is it
> exclusively web based, or could I use it to produce database files for
> use in a (non web app) ruby script?
>
> If not, is there a ruby equivalent to something nice and simple like
> Storable?
>

The standard library comes with dbm, gdbm, sdbm, pstore, and yaml, all
of which can be used as file-based storage. But, as other replies have
pointed out, you probably will not be using them with Rails.

-Justin

MK

5/17/2009 11:46:00 PM

0

James Gray wrote:
> On May 17, 2009, at 1:16 PM, Mk 27 wrote:
>
>> Looks like SQlite would be better...is there a ruby module for that
>> (guess I'll have to go google)?
>
> Multiple libraries, yes. I recommend Amalgalite.
>
> James Edward Gray II

Glancing at Amalgalite it looks exactly like "SQLite3::Database" (which
I just starting using today). Any other (justified) opinions on this?
Or does it not matter much?
--
Posted via http://www.ruby-....

James Gray

5/17/2009 11:58:00 PM

0

On May 17, 2009, at 6:45 PM, Mk 27 wrote:

> James Gray wrote:
>> On May 17, 2009, at 1:16 PM, Mk 27 wrote:
>>
>>> Looks like SQlite would be better...is there a ruby module for that
>>> (guess I'll have to go google)?
>>
>> Multiple libraries, yes. I recommend Amalgalite.
>>
>> James Edward Gray II
>
> Glancing at Amalgalite it looks exactly like
> "SQLite3::Database" (which
> I just starting using today). Any other (justified) opinions on this?
> Or does it not matter much?

Amalgalite embeds SQLite inside of it's extension and thus does not
rely on an external install. It also activates some new features in
it's compile that are nice to have.

James Edward Gray II