On Nov 3, 3:23 pm, Sunny Hirai <[EMAIL PROTECTED]> wrote:
> Is there any way to use double underscores in table names?
>
> I am name spacing tables. For example, if I want to put a "products"
> table in the "store" name space, I want to use the table name
> "store__products". The double underscore is important as it
> differentiates it from a table named simply "store_products" without a
> name space.
>
> Unfortunately, I tried to use both String#lit and Symbol#identifier
> and they both don't work.
You are going to be fighting Sequel with that naming convention, but
it should work:
DB[:store__products.identifier].sql
=> "SELECT * FROM `store__products`"
DB.from('store__products').sql
=> "SELECT * FROM `store__products`"
> This is somewhat important to my implementation and I'd hate to use
> something like "_and_" as the separator since it is both harder to
> understand and longer to read.
>
> e.g.
>
> store__catalog__products
>
> is easier to visually understand than
>
> store_and_catalog_and_products
>
> Thanks.
>
> BTW, as always, I'm a huge fan of this project and have been
> advocating it to whomever I speak to. Love your work guys.
I don't understand why you think store__products is a better name than
store_products, but I suppose you have your reasons. You may have
issues with Sequel if you go this route, so you should make sure you
are convinced that the benefits are worth the costs. Using
Symbol#identifier or other methods should fix the issues, but if it
doesn't, feel free to post issues on the tracker or send me pull
requests.
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
-~----------~----~----~----~------~----~------~--~---