On Jan 29, 4:51 am, Paul Fraser <[email protected]> wrote:
> Hi Jeremy,
> Thanks for adding the h2 adapter.
> It has been working OK for me so far, but I have not pushed it beyond
> some model create_table and add new records.
> My only comment is that most of the sequel examples use a text data type
> and for h2 this produces a clob datatype column. Using varchar works fine.
> I have been experimenting with using java jndi connect strings. The
> Glassfish server requires jndi and I would like to use sequel in that
> environment.
With 2.10.0, you can now do this:
DB.create_table(:table) do
primary_key :id
String :name
DateTime :created_at
end
Basically, you can use ruby class names and they are mapped to
database types. This is different than the old method of using
strings or symbols for types (though that is still fully supported).
If you use the ruby class name, Sequel will use the database type that
it thinks fits best. For example, for String it uses text on
PostgreSQL, and varchar(255) on most other databases.
> The clue to using jndi was provided by Nick Sieger on the JRuby list.
>
> Activerecord-jdbc-adapter has the code to handle JNDI, so Sequel would
> need to have something similar if it was to support it. The code looks
> like this:
>
> http://github.com/nicksieger/activerecord-jdbc-adapter/blob/310de0f32...
I'm not opposed to adding such support if someone sends in a patch. I
don't plan on adding it myself, though.
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
-~----------~----~----~----~------~----~------~--~---