Class: ActiveRecord::ConnectionAdapters::Duckdb::TableDefinition
- Inherits:
-
TableDefinition
- Object
- TableDefinition
- ActiveRecord::ConnectionAdapters::Duckdb::TableDefinition
- Includes:
- ColumnMethods
- Defined in:
- lib/active_record/connection_adapters/duckdb/schema_definitions.rb
Overview
DuckDB-specific table definition for CREATE TABLE statements Extends Rails' TableDefinition with DuckDB column types and features
Instance Method Summary collapse
-
#column(name, type, index: nil, **options) ⇒ void
Creates a column definition for the table Note: sequence defaults are handled by ALTER TABLE after table creation.
-
#initialize(conn, name, temporary: false, if_not_exists: false, options: nil, as: nil, comment: nil, **table_options) ⇒ TableDefinition
constructor
Initialize a new DuckDB table definition.
-
#primary_key(name, type = :primary_key, **options) ⇒ void
Creates a primary key column definition Note: sequence defaults are handled by ALTER TABLE after table creation.
Methods included from ColumnMethods
Constructor Details
#initialize(conn, name, temporary: false, if_not_exists: false, options: nil, as: nil, comment: nil, **table_options) ⇒ TableDefinition
Initialize a new DuckDB table definition
107 108 109 110 111 112 |
# File 'lib/active_record/connection_adapters/duckdb/schema_definitions.rb', line 107 def initialize(conn, name, temporary: false, if_not_exists: false, options: nil, as: nil, comment: nil, **) super @conn = conn @table_name = name end |
Instance Method Details
#column(name, type, index: nil, **options) ⇒ void
This method returns an undefined value.
Creates a column definition for the table Note: sequence defaults are handled by ALTER TABLE after table creation
121 122 123 124 |
# File 'lib/active_record/connection_adapters/duckdb/schema_definitions.rb', line 121 def column(name, type, index: nil, **) # Don't set sequence defaults here - they're handled in create_table via ALTER TABLE super end |
#primary_key(name, type = :primary_key, **options) ⇒ void
This method returns an undefined value.
Creates a primary key column definition Note: sequence defaults are handled by ALTER TABLE after table creation
132 133 134 135 |
# File 'lib/active_record/connection_adapters/duckdb/schema_definitions.rb', line 132 def primary_key(name, type = :primary_key, **) # Don't set sequence defaults here - they're handled in create_table via ALTER TABLE super end |