On 1/29/06, Tom Ward <[EMAIL PROTECTED]> wrote:
> As you can see, you can pass a full connection string as the dsn.  I'd
> like to factor the common parameters out of this string (server, db,
> password, user) and use standard yaml
> attributes to specify them, but I need to check how this will affect
> FreeTDS installations (required to connect from mac, linux) before
> doing this.

Why not have something like this:

server: &server
  driver: /opt/local/whatever-driver.so   # or whatever
  user: my_login
  password: M$_wh0r3
  server: 192.168.2.666
  tds_version: 8.0                                     # if anyone needs this

development:
  database: rails_development
  mode: ODBC
  << *server

special_environment:
  database: rails_whatever_db
  mode: ODBC
  dsn: whatever # overrides any other parameters given
  << *server

... it shouldn't be too hard to check if a 'dsn' key is present, and
if not try and build the DSN string from the server/uid/pwd/driver
values? That way awkward folks on Macs who are too lazy to figure out
how to get proper DSN strings to work (this is me, btw) can set up
their connections in ODBC Administrator and still do their job.

(AFAIK, this code semi-exists in the ADO part of the connection setup
already anyway)

- james
_______________________________________________
Rails-core mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-core

Reply via email to