i’ve got a method to emulate updateable views in postgresql which is
rather
simple. however, i’m wondering if any of the ruby orms out there would
support such a beast. for example, given:
create table foo(
foo text,
id serial,
primary key (id)
);
create table bar(
bar text,
foo_id integer,
id serial,
primary key (id),
foreign key (foo_id) references foo (id)
);
create view foobar as
select
foo.foo as foo,
bar.bar as bar
from foo, bar
where foo.id = bar.foo_id;
i need to be able to do something like this:
db = DB::new options
foo = db.table “foo”
bar = db.table “bar”
foobar = db.view “foobar”
foobar[0][“foo”] = “42”
foobar[0][“bar”] = “forty-two”
p foo[0][“foo”] #=> “42”
p bar[0][“bar”] #=> “forty-two”
i can do this using my code if the view is constructed a certain way,
but i’m
wondering of any of the existing orms have addressed this rather common
need?
regards.
-a