activerecord-advantage-adapter 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b99c457f121d0e626de75648f383a4c74e4e1068de8299fa4676f6174bb90c3
|
4
|
+
data.tar.gz: 2ef0863fd117d012ec8bf3fcc62daff584f66d28124db927d159c3113fbbcbc6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04d3efce90e1c6cd0c8a4cf13c5a3f2b0f7152e97c401e2341463ce9e59e0c26b809eb39c506207e25e705cbe4b1e33e8641dceea9e8dd4dac1f3d9ed043b25b
|
7
|
+
data.tar.gz: 316c0e9ec840e759fa74e63767f7314ab4873e12a0b6abc2bf269e3e16b59e620f4f9be84226f8934b5f59c8a2619af472a8d349632f6d9d6e1ef35f495ba45a
|
@@ -326,6 +326,14 @@ module ActiveRecord
|
|
326
326
|
select(sql, name).map { |row| strip_or_self(row['TABLE_NAME']) }
|
327
327
|
end
|
328
328
|
|
329
|
+
if Rails::VERSION::MAJOR == 5
|
330
|
+
# this really needs fixing, in the case where a database contains views, but that requires
|
331
|
+
# a "data dictionary", and I'm testing against a collection of "database tables"
|
332
|
+
def views(_name = nil)
|
333
|
+
[]
|
334
|
+
end
|
335
|
+
end
|
336
|
+
|
329
337
|
# Return a list of columns
|
330
338
|
def columns(table_name, _name = nil) #:nodoc:
|
331
339
|
table_structure(table_name).map do |field|
|
@@ -503,17 +511,49 @@ SQL
|
|
503
511
|
options.include?(:default) && !(options[:null] == false && options[:default].nil?)
|
504
512
|
end
|
505
513
|
|
514
|
+
|
506
515
|
private
|
507
516
|
|
517
|
+
def type_map
|
518
|
+
@type_map ||= Type::TypeMap.new.tap { |m| initialize_type_map(m) }
|
519
|
+
end
|
520
|
+
|
521
|
+
# copied from "connection_adapters/abstract_adapter.rb"
|
522
|
+
def register_class(mapping, key, klass)
|
523
|
+
mapping.register_type(key) do |*args|
|
524
|
+
klass.new
|
525
|
+
end
|
526
|
+
end
|
527
|
+
|
508
528
|
# Used in the lookup_cast_type procedure
|
509
|
-
def initialize_type_map(m
|
510
|
-
|
529
|
+
def initialize_type_map(m)
|
530
|
+
register_class m, %r(boolean)i, Type::Boolean
|
531
|
+
register_class m, %r(char)i, Type::String
|
532
|
+
register_class m, %r(binary)i, Type::Binary
|
533
|
+
register_class m, %r(text)i, Type::Text
|
534
|
+
register_class m, %r(date)i, Type::Date
|
535
|
+
register_class m, %r(time)i, Type::Time
|
536
|
+
register_class m, %r(datetime)i, Type::DateTime
|
537
|
+
register_class m, %r(float)i, Type::Float
|
538
|
+
register_class m, %r(int)i, Type::Integer
|
539
|
+
register_class m, %r(decimal)i, Type::Decimal
|
540
|
+
|
541
|
+
m.alias_type %r(logical)i, "boolean"
|
542
|
+
m.alias_type %r(numeric)i, "decimal"
|
543
|
+
m.alias_type %r(string)i, "char"
|
511
544
|
m.alias_type %r(memo)i, "char"
|
545
|
+
m.alias_type %r(image)i, "binary"
|
546
|
+
m.alias_type %r(varchar)i, "char"
|
547
|
+
m.alias_type %r(timestamp)i, "datetime"
|
548
|
+
m.alias_type %r(number)i, "decimal"
|
549
|
+
m.alias_type %r(money)i, "decimal"
|
550
|
+
m.alias_type %r(double)i, "float"
|
551
|
+
|
512
552
|
m.alias_type %r(long binary)i, "binary"
|
513
553
|
m.alias_type %r(integer)i, "int"
|
514
554
|
m.alias_type %r(short)i, "int"
|
515
555
|
m.alias_type %r(autoinc)i, "int"
|
516
|
-
m.alias_type %r(
|
556
|
+
m.alias_type %r(raw)i, "binary"
|
517
557
|
end
|
518
558
|
|
519
559
|
# Connect
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-advantage-adapter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Edgar Sherman
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-
|
12
|
+
date: 2023-06-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
110
|
- !ruby/object:Gem::Version
|
111
111
|
version: '0'
|
112
112
|
requirements: []
|
113
|
-
rubygems_version: 3.1.
|
113
|
+
rubygems_version: 3.1.4
|
114
114
|
signing_key:
|
115
115
|
specification_version: 4
|
116
116
|
summary: ActiveRecord driver for Advantage
|