activerecord-libsql 0.1.0 → 0.1.1
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: 7bd70521b40c17e3e116bdb9d70dec71bfa97b2ffbc651555b3f2e9c284b90e2
|
|
4
|
+
data.tar.gz: 5b33ef7cae18df4ffbe9c0805af0b82b1a4291a842a9cdef34ffabe43eddb849
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a743362f8761cd6f69d157bfc266e9874178a3def3592b19f0cdc3391e0ea4fedf7cb7dfd2fb9cf394fffff6408ab313e2044dc934e98c269c7804f8dbd719a4
|
|
7
|
+
data.tar.gz: f15229b17113d1defa3fda201eb34c50ba5bb89b535198fb2f246dfa9f26d64baa36518c28c696c69d3341532336488c94d619abe5d7b5e547c41bbbe52a8324
|
|
@@ -41,6 +41,18 @@ module ActiveRecord
|
|
|
41
41
|
)
|
|
42
42
|
private_constant :READ_QUERY
|
|
43
43
|
|
|
44
|
+
# AR 8.1 で Column.new のシグネチャが変わったため、ロード時に一度だけ決定する
|
|
45
|
+
# AR <= 8.0: Column.new(name, default, sql_type_metadata, null)
|
|
46
|
+
# AR >= 8.1: Column.new(name, cast_type, default, sql_type_metadata, null)
|
|
47
|
+
COLUMN_BUILDER =
|
|
48
|
+
if ActiveRecord::VERSION::MAJOR > 8 ||
|
|
49
|
+
(ActiveRecord::VERSION::MAJOR == 8 && ActiveRecord::VERSION::MINOR >= 1)
|
|
50
|
+
->(name, cast_type, default, sql_type_md, null) { Column.new(name, cast_type, default, sql_type_md, null) }
|
|
51
|
+
else
|
|
52
|
+
->(name, _cast_type, default, sql_type_md, null) { Column.new(name, default, sql_type_md, null) }
|
|
53
|
+
end
|
|
54
|
+
private_constant :COLUMN_BUILDER
|
|
55
|
+
|
|
44
56
|
# -----------------------------------------------------------------------
|
|
45
57
|
# Adapter 識別
|
|
46
58
|
# -----------------------------------------------------------------------
|
|
@@ -208,14 +220,8 @@ module ActiveRecord
|
|
|
208
220
|
sql_type = row['type'].to_s
|
|
209
221
|
cast_type = type_map.lookup(sql_type) || Type::Value.new
|
|
210
222
|
sql_type_md = fetch_type_metadata(sql_type)
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
row['name'],
|
|
214
|
-
cast_type,
|
|
215
|
-
row['dflt_value'],
|
|
216
|
-
sql_type_md,
|
|
217
|
-
row['notnull'].to_i.zero?
|
|
218
|
-
)
|
|
223
|
+
null = row['notnull'].to_i.zero?
|
|
224
|
+
COLUMN_BUILDER.call(row['name'], cast_type, row['dflt_value'], sql_type_md, null)
|
|
219
225
|
end
|
|
220
226
|
end
|
|
221
227
|
|