Skip to content

Commit 49b316a

Browse files
hammerheadamotl
authored andcommitted
Add missing methods in SchemaStatements
1 parent fad25e0 commit 49b316a

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

lib/active_record/connection_adapters/crate/schema_statements.rb

+11-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222
module ActiveRecord
2323
module ConnectionAdapters
2424
module Crate
25-
class SchemaCreation < ActiveRecord::SchemaMigration
26-
25+
class SchemaCreation < ActiveRecord::ConnectionAdapters::SchemaCreation
2726
private
2827

2928
def add_column_options!(sql, options)
@@ -36,6 +35,16 @@ def add_column_options!(sql, options)
3635
end
3736

3837
module SchemaStatements
38+
def data_source_sql(name = nil, type: nil)
39+
# TODO implement
40+
nil
41+
end
42+
43+
def quoted_scope(name = nil, type: nil)
44+
# TODO implement
45+
nil
46+
end
47+
3948
def primary_key(table_name)
4049
res = @connection.execute("select constraint_name from information_schema.table_constraints
4150
where table_name = '#{quote_table_name(table_name)}' and constraint_type = 'PRIMARY_KEY'")

lib/active_record/connection_adapters/crate_adapter.rb

+3-4
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,9 @@ class ColumnDefinition < ActiveRecord::ConnectionAdapters::ColumnDefinition
5959

6060
ADAPTER_NAME = 'Crate'.freeze
6161

62-
# TODO: Croaks with `NotImplementedError`.
63-
# def schema_creation # :nodoc:
64-
# Crate::SchemaCreation.new self
65-
# end
62+
def schema_creation # :nodoc:
63+
Crate::SchemaCreation.new self
64+
end
6665

6766
NATIVE_DATABASE_TYPES = {
6867
boolean: {name: "boolean"},

0 commit comments

Comments
 (0)