Robin H. Johnson
2006-Jun-21 10:12 UTC
Hard Question - ActiveRecord Adapter for a REST service
Hi, So I''ve been lurking a while, and trying to figure out a hard problem that I have. In short, I want to bind an ActiveRecord adapter to a REST service, and be able to perform the basic CRUD actions via the REST interface. No schema changes/migrations, just slinging data. Each REST base URI would be provide a single AR model, which can then be integrated with the rest of the consumer application in the usual AR fashion (validations, associations). I asked in #rubyonrails on Freenode, and somebody there was certain that he''d seen a prototype demo done by David last week, but wasn''t certain if it was what I was looking for. If it is, there''s no mention of it I find on Google, beyond the ActiveSalesforce SOAP->AR adapter. If it''s not, well I guess it''s somewhere that needs the expansion still. I''ve got the problem figured into two conceptual parts 1. REST consumer module. 2. AR specialization of abstract_controller to hook up the REST consumer. The consumer module would have to support multiple variations on REST ideally, but should start with supporting Simply RESTful. (The paragraph below references this page: http://microformats.org/wiki/rest/rails) One issue I''m still stuck with is how to have the REST service declare what it''s schema is. The most obvious solution to this so far is an additional URL method /items/schema that spits out an XML Schema (or another description, based on respond_to?) for the model to be used remotely. However I think violates some of the principles of REST. Questions/comments/suggestions/existing implementations? I''m especially interested in comments about having a non-SQL adapter that can''t change the DB schema at all. -- Robin Hugh Johnson E-Mail : robbat2@gentoo.org GnuPG FP : 11AC BA4F 4778 E3F6 E4ED F38E B27B 944E 3488 4E85 _______________________________________________ Rails-core mailing list Rails-core@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-core
Dr. Ernie Prabhakar
2006-Jul-08 15:20 UTC
Re: Hard Question - ActiveRecord Adapter for a REST service
Hi Robin, You might want to ask on microformats-rest, as we have a lot of Rails gurus there: http://microformats.org/mailman/listinfo/microformats-rest http://microformats.org/wiki/rest Best, -- Ernie P. On Jun 21, 2006, at 3:12 AM, Robin H. Johnson wrote:> Hi, > > So I''ve been lurking a while, and trying to figure out a hard problem > that I have. > > In short, I want to bind an ActiveRecord adapter to a REST service, > and > be able to perform the basic CRUD actions via the REST interface. > No schema changes/migrations, just slinging data. > > Each REST base URI would be provide a single AR model, which can > then be > integrated with the rest of the consumer application in the usual AR > fashion (validations, associations). > > I asked in #rubyonrails on Freenode, and somebody there was certain > that > he''d seen a prototype demo done by David last week, but wasn''t certain > if it was what I was looking for. If it is, there''s no mention of it I > find on Google, beyond the ActiveSalesforce SOAP->AR adapter. If it''s > not, well I guess it''s somewhere that needs the expansion still. > > I''ve got the problem figured into two conceptual parts > 1. REST consumer module. > 2. AR specialization of abstract_controller to hook up the REST > consumer. > > The consumer module would have to support multiple variations on REST > ideally, but should start with supporting Simply RESTful. > > (The paragraph below references this page: > http://microformats.org/wiki/rest/rails) > > One issue I''m still stuck with is how to have the REST service declare > what it''s schema is. The most obvious solution to this so far is an > additional URL method /items/schema that spits out an XML Schema (or > another description, based on respond_to?) for the model to be used > remotely. However I think violates some of the principles of REST. > > Questions/comments/suggestions/existing implementations? > > I''m especially interested in comments about having a non-SQL adapter > that can''t change the DB schema at all. > > -- > Robin Hugh Johnson > E-Mail : robbat2@gentoo.org > GnuPG FP : 11AC BA4F 4778 E3F6 E4ED F38E B27B 944E 3488 4E85 > _______________________________________________ > Rails-core mailing list > Rails-core@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-core
Rick Olson
2006-Jul-08 15:30 UTC
Re: Hard Question - ActiveRecord Adapter for a REST service
On 6/21/06, Robin H. Johnson <robbat2@gentoo.org> wrote:> Hi, > > So I''ve been lurking a while, and trying to figure out a hard problem > that I have. > > In short, I want to bind an ActiveRecord adapter to a REST service, and > be able to perform the basic CRUD actions via the REST interface. > No schema changes/migrations, just slinging data.Look at ActiveResource, announced at RailsConf. It''s not finished, but I think it''s what you''re looking for. -- Rick Olson http://techno-weenie.net