Thanks for the offer to help Jeremy.

Okay, I've got it working in Sequel 2.6 but it is a little
inconsistent in the way I got it to work. Notably, I need to use
String#lit when calling Database#create_table, Database#drop_table or
Database#table_exists? on the Sequel::Database object but I need to
use Symbol#identifier when creating a dataset from a Database object.

My working sample code looks like this:

  @raw_table_name = 'double__underscores'

  db = Sequel.connect( 'mysql://root:[EMAIL PROTECTED]/test' )
  db.drop_table @raw_table_name.lit if db.table_exists?
( @raw_table_name.lit )
  db.create_table @raw_table_name.lit do
    primary_key :id
    column :name, :varchar
  end
  dataset = db[ @raw_table_name.to_sym.identifier ]
  dataset.insert( :name => 'alpha' )
  dataset.insert( :name => 'bravo' )
  dataset.insert( :name => 'charlie' )
  dataset.all

Note that I need to convert the @raw_table_name to a Symbol and then
to an identifier when creating the dataset from @db.

Ultimately, I can work around it now that I know how it works but I'm
wondering if this was by design or just an accident. It would make
code cleaner to not have to do transformations after generating the
table name and instead just generate a single #lit or #identifier
object.

Thanks.

Sunny
--~--~---------~--~----~------------~-------~--~----~
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