Hello Jeremy,

I was just working on a simple Sequel example, and I wrote this:

require "sequel"

DB = Sequel.sqlite

DB.create_table :users do
  prmary_key :id
  column :name, :varchar
end

# ...

I was then getting "mismatched number of keys" errors when declaring 
associations from the User model, and it took me time to realize that I 
misspelled "primary_key". This is SQL that was sent to SQLite:

CREATE TABLE `users` (`id` prmary_key, `name` varchar(255))

I'm wondering if it's possible to be warned about this typo somehow. 
Firstly, I'm surprised that this is valid SQLite statement, I thought 
SQLite would raise an error for unknown database type. Secondly, I wasn't 
aware that the `create_table` block uses method_missing and accepts any 
method, I thought that it has a specified set of methods that it accepts. 
Is there some additional functionality that `method_missing` enables here?

Kind regards,
Janko

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to