On May 27, 12:40 pm, rdouble <[email protected]> wrote: > I'm trying to extend Sequel to improve my ETL scripts for my data > warehouse. > I'm using Aster nCluster as the database, which is postgres + some > proprietary extensions The JDBC driver with jRuby seems to work fine, > with some shortcomings. > In addition to CREATE TABLE, aster has CREATE DIMENSION TABLE and > CREATE FACT TABLE ddl statements. > The syntax is exactly the same as CREATE TABLE, it just puts DIMENSION > and FACT between CREATE and TABLE in the statement. So far I am > getting by with db.execute_ddl. I would like to clean that part of my > ruby script up, which would involve extending Sequel to have functions > like: > > @db = Sequel.connect(@connection_string) > @db.create_fact_table(:demo_fact) do ... > @db.create_dimension_table(:demo_dimension) > > Can someone point me to the Sequel source where I can learn how to do > this?
You'd want to override http://github.com/jeremyevans/sequel/blob/master/lib/sequel/database/schema_methods.rb#L332 You can see where it already supports temporary tables, so you'd probably just want to check the opts for :fact and :dimension, and have create_fact_table do create_table(name, :fact=>true), likewise for dimension. 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.
