activerecord-trilogis-adapter 7.0.1 → 8.0.0

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.
@@ -1,54 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ActiveRecord
4
- module ConnectionAdapters
5
- module Trilogis
6
- module ColumnMethods
7
- def spatial(name, options = {})
8
- raise "You must set a type. For example: 't.spatial type: :st_point'" unless options[:type]
9
-
10
- column(name, options[:type], **options)
11
- end
12
-
13
- def geometry(name, options = {})
14
- column(name, :geometry, **options)
15
- end
16
-
17
- def geometry_collection(name, options = {})
18
- column(name, :geometrycollection, **options)
19
- end
20
- alias geometrycollection geometry_collection
21
-
22
- def line_string(name, options = {})
23
- column(name, :linestring, **options)
24
- end
25
- alias linestring line_string
26
-
27
- def multi_line_string(name, options = {})
28
- column(name, :multilinestring, **options)
29
- end
30
- alias multilinestring multi_line_string
31
-
32
- def multi_point(name, options = {})
33
- column(name, :multipoint, **options)
34
- end
35
- alias multipoint multi_point
36
-
37
- def multi_polygon(name, options = {})
38
- column(name, :multipolygon, **options)
39
- end
40
- alias multipolygon multi_polygon
41
-
42
- def point(name, options = {})
43
- column(name, :point, **options)
44
- end
45
-
46
- def polygon(name, options = {})
47
- column(name, :polygon, **options)
48
- end
49
- end
50
- end
51
-
52
- MySQL::Table.include Trilogis::ColumnMethods
53
- end
54
- end
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "trilogy"
4
- require "active_record/connection_adapters/trilogy_adapter"
5
- require "active_record/connection_adapters/trilogis_adapter"
6
-
7
- module ActiveRecord
8
- module ConnectionAdapters
9
- class TrilogisAdapter
10
- module Connection
11
- def trilogy_adapter_class
12
- ActiveRecord::ConnectionAdapters::TrilogisAdapter
13
- end
14
- end
15
- end
16
- end
17
- end
@@ -1,48 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ActiveRecord
4
- module ConnectionAdapters
5
- class TrilogisAdapter
6
- module Rails
7
- module DBConsole
8
- class AdapterAdapter < SimpleDelegator
9
- def adapter
10
- "mysql"
11
- end
12
- end
13
-
14
- def db_config
15
- if super.adapter == "trilogis"
16
- AdapterAdapter.new(super)
17
- else
18
- super
19
- end
20
- end
21
- end
22
- end
23
- end
24
- end
25
- end
26
-
27
- module Rails
28
- class DBConsole
29
- # require "rails/commands/dbconsole/dbconsole_command"
30
- if ActiveRecord.version < ::Gem::Version.new('6.1.a')
31
- alias _brick_start start
32
-
33
- def start
34
- ENV["RAILS_ENV"] ||= @options[:environment] || environment
35
-
36
- if config["adapter"] == "trilogis"
37
- begin
38
- ::ActiveRecord::ConnectionAdapters::TrilogisAdapter.dbconsole(config, @options)
39
- rescue NotImplementedError
40
- abort "Unknown command-line client for #{db_config.database}."
41
- end
42
- else
43
- _brick_start
44
- end
45
- end
46
- end
47
- end
48
- end