I''d like to propose a patch to the parsing of database.yml to allow using database uri''s instead of specifying each config. Current: production: adapter: postgresql encoding: unicode pool: 5 database: production_db username: user password: passwd host: database.host.com port: 5432 Proposed alternative: production: uri: postgres://username:password@database.host.com:5432/production_db pool: 5 This would be my first feature patch to rails, so if y''all like the idea, I''d love some tips on how to implement it as well. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/BRUoZKOfWe8J. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
> Proposed alternative: > > production: > uri: postgres://username:password@database.host.com:5432/production_db > pool: 5Alternative: production: "postgres://username:password@database.host.com:5432/production_db?pool=5" Robert Pankowecki http://robert.pankowecki.pl -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
What makes that solution better than the current (more readable) version? On Mon, Sep 24, 2012 at 4:28 PM, Robert Pankowecki < robert.pankowecki@gmail.com> wrote:> > Proposed alternative: > > > > production: > > uri: postgres://username:password@database.host.com:5432/production_db > > pool: 5 > > Alternative: > > production: "postgres:// > username:password@database.host.com:5432/production_db?pool=5" > > Robert Pankowecki > http://robert.pankowecki.pl > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To post to this group, send email to rubyonrails-core@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-core+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
On Mon, Sep 24, 2012 at 4:29 PM, Fabian Becker <fabian.becker87@gmail.com> wrote:> What makes that solution better than the current (more readable) version?It is less verbose I guess. Also java, .net and mongo use/support connection strings. Robert Pankowecki -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
I like it. Heroku does this too. On Monday, September 24, 2012, Robert Pankowecki wrote:> On Mon, Sep 24, 2012 at 4:29 PM, Fabian Becker > <fabian.becker87@gmail.com <javascript:;>> wrote: > > What makes that solution better than the current (more readable) version? > > It is less verbose I guess. Also java, .net and mongo use/support > connection strings. > > Robert Pankowecki > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To post to this group, send email to rubyonrails-core@googlegroups.com<javascript:;> > . > To unsubscribe from this group, send email to > rubyonrails-core+unsubscribe@googlegroups.com <javascript:;>. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
On Mon, Sep 24, 2012 at 04:28:33PM +0200, Robert Pankowecki wrote:> > Proposed alternative: > > > > production: > > uri: postgres://username:password@database.host.com:5432/production_db > > pool: 5 > > Alternative: > > production: "postgres://username:password@database.host.com:5432/production_db?pool=5"I *think* this is supported now, just not specifically tested. If it doesn''t actually work, then we should make it work. -- Aaron Patterson http://tenderlovemaking.com/
Hi, Aaron, I can''t find any information for that. How can I specify `uri`? 在 2012年9月25日星期二UTC+8上午1时56分07秒,Aaron Patterson写道:> > On Mon, Sep 24, 2012 at 04:28:33PM +0200, Robert Pankowecki wrote: > > > Proposed alternative: > > > > > > production: > > > uri: postgres:// > username:password@database.host.com:5432/production_db > > > pool: 5 > > > > Alternative: > > > > production: "postgres:// > username:password@database.host.com:5432/production_db?pool=5" > > I *think* this is supported now, just not specifically tested. If it > doesn''t actually work, then we should make it work. > > -- > Aaron Patterson > http://tenderlovemaking.com/ >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-core+unsubscribe@googlegroups.com. To post to this group, send email to rubyonrails-core@googlegroups.com. Visit this group at http://groups.google.com/group/rubyonrails-core. For more options, visit https://groups.google.com/groups/opt_out.