On Dec 15, 1:21 pm, Doug Tykocki <[email protected]> wrote:
> I don't necessarily need the "..", it's just a nice bit of shorthand
> for using dbo in queries. But anyways, your example works as long as
> dbo is specified:
>
> DB1[:database__dbo__table___t1]
>
> Which results in:
>
> SELECT * FROM [database].[dbo].[table] AS [t1]

The fact that that syntax (a__b__c___d) works is just an accident due
to a bug in Dataset#from (calling :to_sym on a string instead of
creating an SQL::Identifier with it).

Sequel only supports the following when splitting symbols:

  :a__b => a.b
  :a___c => a AS c
  :a__b___c => a.b AS c

You should use this instead:

  DB1[:dbo__table.qualify(:database).as(:t1)]

I'm going to commit a change that fixes the bug and will break the
syntax you are using.  I agree that your version is more friendly to
your use case, but it's inconsistent with the rest of Sequel's
behavior, and will lead users to believe that they can use that syntax
in other places, which won't work.

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