File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
lib/active_record/connection_adapters/cockroachdb Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,21 @@ def quoted_date(value)
5959 # This is tested by `BasicsTest#test_default_in_local_time`.
6060 super + value . strftime ( "%z" )
6161 end
62+
63+ # NOTE: This method should be private in future rails versions.
64+ # Hence we should also make it private then.
65+ #
66+ # See https://github.com/rails/rails/blob/v8.1.1/activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb#L190
67+ def lookup_cast_type ( sql_type )
68+ type_map . lookup (
69+ # oid
70+ query_value ( "SELECT #{ quote ( sql_type ) } ::regtype::oid" , "SCHEMA" ) . to_i ,
71+ # fmod, not needed.
72+ nil ,
73+ # details needed for `..::CockroachDB::OID::Spatial` (e.g. `geometry(point,3857)`)
74+ sql_type
75+ )
76+ end
6277 end
6378 end
6479 end
You can’t perform that action at this time.
0 commit comments