Thanks, this worked great. I also have to add a new type of constraint, "PARTITION KEY." Do you know where I should look to add this constraint?
for instance, a table definition would look like: CREATE FACT TABLE weather ( cityid int, temp_lo int, temp_hi int, prcp real, obs_date date, PARTITION KEY( cityid ) ); The fact tables always need a partition key. I've tried using the built in constraint and method_missing, but it didn't work. Maybe I am just doing it wrong? Thanks, Rolf On Thu, May 27, 2010 at 4:18 PM, Jeremy Evans <[email protected]> wrote: > 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. > > -- 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.
