class ActiveRecord::ConnectionAdapters::CrateAdapter
Constants
- ADAPTER_NAME
- NATIVE_DATABASE_TYPES
Public Class Methods
new(connection, logger, pool, config)
click to toggle source
Calls superclass method
# File lib/active_record/connection_adapters/crate_adapter.rb, line 82 def initialize(connection, logger, pool, config) @port = config[:port] @host = config[:host] super(connection, logger, pool) @schema_cache = SchemaCache.new self @visitor = Arel::Visitors::Crate.new self @quoted_column_names = {} connect end
Public Instance Methods
active?()
click to toggle source
TODO check what call to use for active
# File lib/active_record/connection_adapters/crate_adapter.rb, line 111 def active? true end
adapter_name()
click to toggle source
# File lib/active_record/connection_adapters/crate_adapter.rb, line 92 def adapter_name ADAPTER_NAME end
clear_cache!()
click to toggle source
TODO
# File lib/active_record/connection_adapters/crate_adapter.rb, line 116 def clear_cache! end
connect()
click to toggle source
# File lib/active_record/connection_adapters/crate_adapter.rb, line 127 def connect @connection = CrateRuby::Client.new(["#{@host}:#{@port}"]) end
create_table_definition(name, temporary, options, as = nil)
click to toggle source
# File lib/active_record/connection_adapters/crate_adapter.rb, line 222 def create_table_definition(name, temporary, options, as = nil) TableDefinition.new native_database_types, name, temporary, options, as end
dotted_name(name)
click to toggle source
# File lib/active_record/connection_adapters/crate_adapter.rb, line 139 def dotted_name(name) name.gsub(%r(\[['"]), '.').delete(%{'"]}) end
migration_keys()
click to toggle source
Adds ‘:array` as a valid migration key
Calls superclass method
# File lib/active_record/connection_adapters/crate_adapter.rb, line 105 def migration_keys super + [:array, :object_schema_behaviour, :object_schema] end
native_database_types()
click to toggle source
# File lib/active_record/connection_adapters/crate_adapter.rb, line 226 def native_database_types NATIVE_DATABASE_TYPES end
prepare_column_options(column, types)
click to toggle source
Adds ‘:array` option to the default set provided by the AbstractAdapter
Calls superclass method
# File lib/active_record/connection_adapters/crate_adapter.rb, line 98 def prepare_column_options(column, types) spec = super spec[:array] = 'true' if column.respond_to?(:array) && column.array spec end
reset!()
click to toggle source
TODO
# File lib/active_record/connection_adapters/crate_adapter.rb, line 120 def reset! end
supports_migrations?()
click to toggle source
# File lib/active_record/connection_adapters/crate_adapter.rb, line 123 def supports_migrations? true end
tables()
click to toggle source
# File lib/active_record/connection_adapters/crate_adapter.rb, line 143 def tables @connection.tables end