ovirt_metrics 3.0.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -1
- data/lib/active_record/connection_adapters/ovirt_postgresql_adapter.rb +31 -0
- data/lib/ovirt_metrics/version.rb +1 -1
- data/lib/ovirt_metrics.rb +4 -1
- data/spec/spec_helper.rb +3 -0
- metadata +37 -50
- data/lib/active_record/connection_adapters/ovirt_legacy_postgresql/column.rb +0 -15
- data/lib/active_record/connection_adapters/ovirt_legacy_postgresql/database_statements.rb +0 -170
- data/lib/active_record/connection_adapters/ovirt_legacy_postgresql/explain_pretty_printer.rb +0 -42
- data/lib/active_record/connection_adapters/ovirt_legacy_postgresql/oid/array.rb +0 -70
- data/lib/active_record/connection_adapters/ovirt_legacy_postgresql/oid/bit.rb +0 -52
- data/lib/active_record/connection_adapters/ovirt_legacy_postgresql/oid/bit_varying.rb +0 -13
- data/lib/active_record/connection_adapters/ovirt_legacy_postgresql/oid/bytea.rb +0 -15
- data/lib/active_record/connection_adapters/ovirt_legacy_postgresql/oid/cidr.rb +0 -48
- data/lib/active_record/connection_adapters/ovirt_legacy_postgresql/oid/date_time.rb +0 -21
- data/lib/active_record/connection_adapters/ovirt_legacy_postgresql/oid/decimal.rb +0 -13
- data/lib/active_record/connection_adapters/ovirt_legacy_postgresql/oid/enum.rb +0 -19
- data/lib/active_record/connection_adapters/ovirt_legacy_postgresql/oid/hstore.rb +0 -59
- data/lib/active_record/connection_adapters/ovirt_legacy_postgresql/oid/inet.rb +0 -13
- data/lib/active_record/connection_adapters/ovirt_legacy_postgresql/oid/json.rb +0 -10
- data/lib/active_record/connection_adapters/ovirt_legacy_postgresql/oid/jsonb.rb +0 -23
- data/lib/active_record/connection_adapters/ovirt_legacy_postgresql/oid/money.rb +0 -39
- data/lib/active_record/connection_adapters/ovirt_legacy_postgresql/oid/point.rb +0 -43
- data/lib/active_record/connection_adapters/ovirt_legacy_postgresql/oid/rails_5_1_point.rb +0 -50
- data/lib/active_record/connection_adapters/ovirt_legacy_postgresql/oid/range.rb +0 -93
- data/lib/active_record/connection_adapters/ovirt_legacy_postgresql/oid/specialized_string.rb +0 -15
- data/lib/active_record/connection_adapters/ovirt_legacy_postgresql/oid/type_map_initializer.rb +0 -109
- data/lib/active_record/connection_adapters/ovirt_legacy_postgresql/oid/uuid.rb +0 -21
- data/lib/active_record/connection_adapters/ovirt_legacy_postgresql/oid/vector.rb +0 -26
- data/lib/active_record/connection_adapters/ovirt_legacy_postgresql/oid/xml.rb +0 -28
- data/lib/active_record/connection_adapters/ovirt_legacy_postgresql/oid.rb +0 -31
- data/lib/active_record/connection_adapters/ovirt_legacy_postgresql/quoting.rb +0 -116
- data/lib/active_record/connection_adapters/ovirt_legacy_postgresql/referential_integrity.rb +0 -49
- data/lib/active_record/connection_adapters/ovirt_legacy_postgresql/schema_definitions.rb +0 -180
- data/lib/active_record/connection_adapters/ovirt_legacy_postgresql/schema_dumper.rb +0 -47
- data/lib/active_record/connection_adapters/ovirt_legacy_postgresql/schema_statements.rb +0 -682
- data/lib/active_record/connection_adapters/ovirt_legacy_postgresql/type_metadata.rb +0 -35
- data/lib/active_record/connection_adapters/ovirt_legacy_postgresql/utils.rb +0 -77
- data/lib/active_record/connection_adapters/ovirt_legacy_postgresql_adapter.rb +0 -856
@@ -1,35 +0,0 @@
|
|
1
|
-
module ActiveRecord
|
2
|
-
module ConnectionAdapters
|
3
|
-
class OvirtLegacyPostgreSQLTypeMetadata < DelegateClass(SqlTypeMetadata)
|
4
|
-
attr_reader :oid, :fmod, :array
|
5
|
-
|
6
|
-
def initialize(type_metadata, oid: nil, fmod: nil)
|
7
|
-
super(type_metadata)
|
8
|
-
@type_metadata = type_metadata
|
9
|
-
@oid = oid
|
10
|
-
@fmod = fmod
|
11
|
-
@array = /\[\]$/ === type_metadata.sql_type
|
12
|
-
end
|
13
|
-
|
14
|
-
def sql_type
|
15
|
-
super.gsub(/\[\]$/, "".freeze)
|
16
|
-
end
|
17
|
-
|
18
|
-
def ==(other)
|
19
|
-
other.is_a?(OvirtLegacyPostgreSQLTypeMetadata) &&
|
20
|
-
attributes_for_hash == other.attributes_for_hash
|
21
|
-
end
|
22
|
-
alias eql? ==
|
23
|
-
|
24
|
-
def hash
|
25
|
-
attributes_for_hash.hash
|
26
|
-
end
|
27
|
-
|
28
|
-
protected
|
29
|
-
|
30
|
-
def attributes_for_hash
|
31
|
-
[self.class, @type_metadata, oid, fmod]
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
@@ -1,77 +0,0 @@
|
|
1
|
-
module ActiveRecord
|
2
|
-
module ConnectionAdapters
|
3
|
-
module OvirtLegacyPostgreSQL
|
4
|
-
# Value Object to hold a schema qualified name.
|
5
|
-
# This is usually the name of a PostgreSQL relation but it can also represent
|
6
|
-
# schema qualified type names. +schema+ and +identifier+ are unquoted to prevent
|
7
|
-
# double quoting.
|
8
|
-
class Name # :nodoc:
|
9
|
-
SEPARATOR = "."
|
10
|
-
attr_reader :schema, :identifier
|
11
|
-
|
12
|
-
def initialize(schema, identifier)
|
13
|
-
@schema, @identifier = unquote(schema), unquote(identifier)
|
14
|
-
end
|
15
|
-
|
16
|
-
def to_s
|
17
|
-
parts.join SEPARATOR
|
18
|
-
end
|
19
|
-
|
20
|
-
def quoted
|
21
|
-
if schema
|
22
|
-
PGconn.quote_ident(schema) << SEPARATOR << PGconn.quote_ident(identifier)
|
23
|
-
else
|
24
|
-
PGconn.quote_ident(identifier)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
def ==(o)
|
29
|
-
o.class == self.class && o.parts == parts
|
30
|
-
end
|
31
|
-
alias_method :eql?, :==
|
32
|
-
|
33
|
-
def hash
|
34
|
-
parts.hash
|
35
|
-
end
|
36
|
-
|
37
|
-
protected
|
38
|
-
def unquote(part)
|
39
|
-
if part && part.start_with?('"')
|
40
|
-
part[1..-2]
|
41
|
-
else
|
42
|
-
part
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
def parts
|
47
|
-
@parts ||= [@schema, @identifier].compact
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
module Utils # :nodoc:
|
52
|
-
extend self
|
53
|
-
|
54
|
-
# Returns an instance of <tt>ActiveRecord::ConnectionAdapters::PostgreSQL::Name</tt>
|
55
|
-
# extracted from +string+.
|
56
|
-
# +schema+ is nil if not specified in +string+.
|
57
|
-
# +schema+ and +identifier+ exclude surrounding quotes (regardless of whether provided in +string+)
|
58
|
-
# +string+ supports the range of schema/table references understood by PostgreSQL, for example:
|
59
|
-
#
|
60
|
-
# * <tt>table_name</tt>
|
61
|
-
# * <tt>"table.name"</tt>
|
62
|
-
# * <tt>schema_name.table_name</tt>
|
63
|
-
# * <tt>schema_name."table.name"</tt>
|
64
|
-
# * <tt>"schema_name".table_name</tt>
|
65
|
-
# * <tt>"schema.name"."table name"</tt>
|
66
|
-
def extract_schema_qualified_name(string)
|
67
|
-
schema, table = string.scan(/[^".\s]+|"[^"]*"/)
|
68
|
-
if table.nil?
|
69
|
-
table = schema
|
70
|
-
schema = nil
|
71
|
-
end
|
72
|
-
OvirtLegacyPostgreSQL::Name.new(schema, table)
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|