Module: ParadeDB
- Defined in:
- lib/parade_db/arel/nodes.rb,
lib/parade_db.rb,
lib/parade_db/arel.rb,
lib/parade_db/index.rb,
lib/parade_db/model.rb,
lib/parade_db/query.rb,
lib/parade_db/errors.rb,
lib/parade_db/railtie.rb,
lib/parade_db/version.rb,
lib/parade_db/proximity.rb,
lib/parade_db/diagnostics.rb,
lib/parade_db/aggregations.rb,
lib/parade_db/arel/builder.rb,
lib/parade_db/arel/visitor.rb,
lib/parade_db/tokenizer_sql.rb,
lib/parade_db/search_methods.rb,
lib/parade_db/arel/predications.rb,
lib/parade_db/migration_helpers.rb,
lib/generators/parade_db/index/index_generator.rb,
lib/parade_db/migration_helpers.rb,
lib/parade_db/migration_helpers.rb,
lib/parade_db/migration_helpers.rb
Overview
rubocop:disable Lint/MissingSuper
Defined Under Namespace
Modules: Aggregations, Arel, CommandRecorderPatch, Diagnostics, Errors, Generators, MigrationDSL, MigrationHelpers, Model, Proximity, Query, SchemaDumperPatch, SearchMethods, TokenizerSQL
Classes: Index, Railtie
Constant Summary
collapse
- FacetQueryError =
Errors::FacetQueryError
- InvalidIndexDefinition =
Errors::InvalidIndexDefinition
- UnsupportedAdapterError =
Errors::UnsupportedAdapterError
- MethodCollisionError =
Errors::MethodCollisionError
- FieldNotIndexed =
Errors::FieldNotIndexed
- IndexClassNotFoundError =
Errors::IndexClassNotFoundError
- IndexDriftError =
Errors::IndexDriftError
- VERSION =
"0.5.0"
Class Method Summary
collapse
Class Method Details
.ensure_postgresql_adapter!(connection, context:) ⇒ Object
70
71
72
73
74
75
76
77
|
# File 'lib/parade_db.rb', line 70
def ensure_postgresql_adapter!(connection, context:)
adapter_name = connection.adapter_name.to_s
normalized = adapter_name.downcase
return if normalized.include?("postgres") || normalized.include?("postgis")
raise Errors::UnsupportedAdapterError,
"#{context} only supports PostgreSQL. Current adapter: #{adapter_name.inspect}"
end
|
.index_validation_mode ⇒ Object
43
44
45
|
# File 'lib/parade_db.rb', line 43
def index_validation_mode
@index_validation_mode ||= :off
end
|
.index_validation_mode=(mode) ⇒ Object
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
# File 'lib/parade_db.rb', line 47
def index_validation_mode=(mode)
valid_modes = %i[warn raise off]
normalized =
case mode
when Symbol
mode
when String
stripped = mode.strip
raise ArgumentError, "index_validation_mode must be one of: #{valid_modes.join(', ')}" if stripped.empty?
stripped.to_sym
else
raise ArgumentError, "index_validation_mode must be one of: #{valid_modes.join(', ')}"
end
if valid_modes.include?(normalized)
@index_validation_mode = normalized
return
end
raise ArgumentError, "index_validation_mode must be one of: #{valid_modes.join(', ')}"
end
|
.paradedb_index_segments(index, connection: ActiveRecord::Base.connection) ⇒ Object
31
32
33
|
# File 'lib/parade_db.rb', line 31
def paradedb_index_segments(index, connection: ActiveRecord::Base.connection)
Diagnostics.index_segments(index, connection: connection)
end
|
.paradedb_indexes(connection: ActiveRecord::Base.connection) ⇒ Object
27
28
29
|
# File 'lib/parade_db.rb', line 27
def paradedb_indexes(connection: ActiveRecord::Base.connection)
Diagnostics.indexes(connection: connection)
end
|
.paradedb_verify_all_indexes(**options) ⇒ Object
.paradedb_verify_index(index, **options) ⇒ Object
35
36
37
|
# File 'lib/parade_db.rb', line 35
def paradedb_verify_index(index, **options)
Diagnostics.verify_index(index, **options)
end
|
.proximity(*terms) ⇒ Object
83
84
85
|
# File 'lib/parade_db.rb', line 83
def proximity(*terms)
Proximity::Clause.new(*terms)
end
|
.regex_term(pattern, max_expansions: nil) ⇒ Object
79
80
81
|
# File 'lib/parade_db.rb', line 79
def regex_term(pattern, max_expansions: nil)
Proximity::RegexTerm.new(pattern, max_expansions: max_expansions)
end
|