Class: Sequel::Redshift::Database
- Inherits:
-
Postgres::Database
- Object
- Postgres::Database
- Sequel::Redshift::Database
- Defined in:
- lib/sequel/adapters/redshift.rb
Constant Summary collapse
- SORTSTYLES =
[:compound, :interleaved].freeze
- DISTSTYLES =
[:even, :key, :all].freeze
- DatasetClass =
self
Instance Method Summary collapse
- #connection_configuration_sqls ⇒ Object
- #optimize_table(table, create_options) ⇒ Object
- #serial_primary_key_options ⇒ Object
- #supports_index_parsing? ⇒ Boolean
Methods inherited from Postgres::Database
Instance Method Details
#connection_configuration_sqls ⇒ Object
34 35 36 |
# File 'lib/sequel/adapters/redshift.rb', line 34 def connection_configuration_sqls [] end |
#optimize_table(table, create_options) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/sequel/adapters/redshift.rb', line 12 def optimize_table(table, ) extension :redshift_schema_dumper transaction do gen = dump_table_generator(table) rename_table table, :"old_#{table}" create_table(:"new_#{table}", ) do instance_eval(gen.dump_columns, __FILE__, __LINE__) instance_eval(gen.dump_constraints, __FILE__, __LINE__) instance_eval(gen.dump_indexes, __FILE__, __LINE__) end run %Q{INSERT INTO "new_#{table}" (SELECT * FROM "old_#{table}")} rename_table :"new_#{table}", table drop_table :"old_#{table}" end end |
#serial_primary_key_options ⇒ Object
29 30 31 32 |
# File 'lib/sequel/adapters/redshift.rb', line 29 def # redshift doesn't support serial type super.merge(serial: false) end |
#supports_index_parsing? ⇒ Boolean
38 39 40 |
# File 'lib/sequel/adapters/redshift.rb', line 38 def supports_index_parsing? false end |