On Nov 25, 9:46 am, Hillary <[email protected]> wrote:
> Using the Class Method, I'm getting two errors, one is a SQL Server does
> not exist or access denied and another is a can't parse the yml file at
> line x column 0.

In the future, please provide full backtraces, it helps debugging.

> my database.yml looks like this:
> qa:
>   adaptor: sqlserver
>   mode: ado
>   server: <servername>
>   database: <db>
>   username: <user>
>   password: <password>

This configuration is not valid for Sequel.  Sequel doesn't have an
sqlserver adaptor (which is mispelled).  Sequel uses user instead of
username and host instead of server.  You probably want:

qa:
  adapter: ado
  host: <servername>
  database: <db>
  user: <user>
  password: <password>

> The other option in that thread was to directly call the string, with that
> option i get an invalid argument error.
> My code looks like this     TAZA_ROOT = "
> File.dirname(__FILE__)}/../config/"
>     $DB =
> DB.ado(YAML.load_file(File.read(File.join(TAZA_ROOT,'database.yml')))['TAZA_ENV'])

One of the errors in this line is that you are using 'TAZA_ENV'
instead of ENV['TAZA_ENV'].

> Number #2
>
> I'm not really sure where to start.

I would think that a similar approach (using an environment variable)
would work fine.  If the environment variable is set, override
the :database entry in the connection hash with it before passing the
hash to Sequel.

Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.

Reply via email to