Re:PostgreSQL 9.3 Beta 1 Released
by btown on Monday May 13, 2013 @11:03AM
(#5699039)
Where would one find out if anyone is working on a patch for ActiveRecord?
[ Parent
| on HN ]
The Rails/ActiveRecord bug tracker?
edit: the underlying connector might be a better idea to start with, as it'll need to expose the fields somehow before an ORM can take advantage of them.
Looks like work has started on the underlying connector: https://bitbucket.org/ged/ruby-pg/issue/161/add-support-for-...
I wouldn't say "work has started" when the bug has just been reported.
This is where you'd want to be looking in the source:
https://github.com/rails/rails/tree/master/activerecord/lib/...
Specifically at any error handling, which I think would likely be here:
https://github.com/rails/rails/blob/master/activerecord/lib/...
I think it can use either pg (wrapper around libpq) or postgres-pr (pure ruby), though I always use pg.
EDIT: Seems like they have dropped support for postgres.
EDIT2: Yes, I did mean postgres-pr.
Do you mean postgres-pr? (postgres is marked as a deprecated gem to replace with pg)
Re:PostgreSQL 9.3 Beta 1 Released
by moonlight80 on Tuesday May 14, 2013 @04:53AM
(#5703670)
I think ActiveRecord pattern is more limiting you than helpful. I found the following post quite interesting:
http://mindref.blogspot.com/2013/02/sql-vs-orm.html
ActiveRecord doesn't even support constraints in the first place.
Shameless plug: here is a gem I wrote to manage foreign keys and CHECK constraints (and also indexes) in a Rails project:
What do you mean by "support constraints"?
If I, for example, violate a unique index, a ActiveRecord::RecordNotUnique exception is raised.
Is that true? I might be wrong about this, but I think ActiveRecord checks for uniqueness (and other constraints) in application code, generating an extra database query if needed. If you _actually_ violate the unique index, a PGError is raised (if using postgres).
Re:PostgreSQL 9.3 Beta 1 Released
by FooBarWidget on Monday May 13, 2013 @04:24PM
(#5701158)
No. ActiveRecord checks for constraints on top of what the database offers. You are free to specify database constraints if you like. In older versions of ActiveRecord, uniqueness errors generate a generic database exception. In recent versions, uniqueness errors generate the specific exception RecordNotUnique.