Forum: Ruby on Rails ActiveRecord without database

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Andrea R. (Guest)
on 2006-01-30 11:08
The question is this.
Can I use ActiveRecord without the presence of a database?
I use only YAML file for my project and I would like use the power of
ActiveRecord for my models. I have not tested and so I ask you if this
is possible.

Thanks so much.
--Reis
Arie Kusuma A. (Guest)
on 2006-01-30 11:35
(Received via mailing list)
http://wiki.rubyonrails.org/rails/pages/HowToUseVa...
http://www.realityforge.org/articles/2005/12/02/va...

On 1/30/06, Andrea R. <removed_email_address@domain.invalid> wrote:
> The question is this.
> Can I use ActiveRecord without the presence of a database?
> I use only YAML file for my project and I would like use the power of
> ActiveRecord for my models. I have not tested and so I ask you if this
> is possible.

--
kind_regards = {
  :name  => "Arie",
  :Y!    => "riyari3",
  :email => "removed_email_address@domain.invalid"
}
Andrea R. (Guest)
on 2006-01-30 12:41
Ezra Z. (Guest)
on 2006-01-30 19:28
(Received via mailing list)
On Jan 30, 2006, at 1:08 AM, Andrea R. wrote:

> The question is this.
> Can I use ActiveRecord without the presence of a database?
> I use only YAML file for my project and I would like use the power of
> ActiveRecord for my models. I have not tested and so I ask you if this
> is possible.
>
> Thanks so much.
> --Reis
>
> --

You can easily use rails without using ActiveRecord for the models.
If you just want to use yaml as your models then you are already
there you can eaily just load yaml into hashes or arrays and use them
in the views or wherever. But If you want database type relationships
you will need to use AR or maybe you want to look at kirbybase, a
pure ruby database that is nice and powerfull and uses ruby blocks as
its query language. Kirbybase stores its database in a plain text
file but has indexes so its still very fast.

	But alas, the power of rails is closely tied to ActiveRecord and I
think that you will be swimming upstream without it once things get
complicated. Can you elaborate on what you want to do that doesn't
need a database but needs to store in yaml files?

Cheers

-Ezra Z.
Yakima Herald-Republic
WebMaster
http://yakimaherald.com
509-577-7732
removed_email_address@domain.invalid
This topic is locked and can not be replied to.