activerecord-graph-extractor 0.1.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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: f64bcc21e756d5c43f0718c2e582f1f39a71f2a612f1a1c15103690fd6c82989
4
+ data.tar.gz: 8b0a59753bf91dab1f7fe04859edeb67c9bd920cbb0f515ac5c422a806a8eeaa
5
+ SHA512:
6
+ metadata.gz: bf60e230bd435b0fa9b7463181dde2591a85a73711b9928cc7a35649999afaf28f3b0e93c40a34b4ede516be364e4a6557876e8e58760825c38b9aa3f8ba490d
7
+ data.tar.gz: 37e91e7e9006a1a133819e98155adfac51ce2d8685f79591103183045390a9cf5796b68ae4fc8264566d4ec949733183f2f7b5db49c1081fd9593b600c9ed7c0
data/.rspec ADDED
@@ -0,0 +1,4 @@
1
+ --require spec_helper
2
+ --color
3
+ --format documentation
4
+ --order random
data/CHANGELOG.md ADDED
@@ -0,0 +1,36 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.1.0] - 2025-01-28
11
+
12
+ ### Added
13
+ - Initial release of ActiveRecord Graph Extractor
14
+ - Core extraction functionality with relationship traversal
15
+ - Smart dependency resolution for import order
16
+ - Beautiful CLI with progress visualization
17
+ - Memory-efficient streaming for large datasets
18
+ - Comprehensive configuration options
19
+ - Transaction-safe imports with rollback
20
+ - Support for circular reference detection and handling
21
+ - Primary key mapping and foreign key resolution
22
+ - JSON validation and error handling
23
+ - Support for polymorphic associations
24
+ - Batch processing for performance
25
+ - Progress tracking and callbacks
26
+ - CLI commands: extract, import, analyze
27
+ - Comprehensive documentation and examples
28
+
29
+ ### Features
30
+ - **Extractor**: Complete object graph extraction with configurable depth and relationships
31
+ - **Importer**: Dependency-aware import with primary key remapping
32
+ - **CLI**: Beautiful terminal interface with colors, progress bars, and spinners
33
+ - **Configuration**: Highly configurable traversal rules and import options
34
+ - **Error Handling**: Comprehensive error handling with detailed error messages
35
+ - **Performance**: Memory-efficient processing with streaming JSON support
36
+ - **Safety**: Transaction-wrapped imports with automatic rollback on errors
data/Gemfile ADDED
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in activerecord-graph-extractor.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+ gem "rspec", "~> 3.0"
10
+ gem "rubocop", "~> 1.21"
11
+
12
+ # Development and testing
13
+ gem "pry", "~> 0.14"
14
+ gem "sqlite3", "~> 1.4"
15
+ gem "database_cleaner", "~> 2.0"
16
+ gem "factory_bot", "~> 6.2"
17
+ gem "simplecov", "~> 0.22"
data/Gemfile.lock ADDED
@@ -0,0 +1,201 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ activerecord-graph-extractor (0.1.0)
5
+ activerecord (>= 6.0)
6
+ activesupport (>= 6.0)
7
+ aws-sdk-s3 (~> 1.0)
8
+ oj (~> 3.13)
9
+ pastel (~> 0.8)
10
+ thor (~> 1.2)
11
+ tty-progressbar (~> 0.18)
12
+ tty-prompt (~> 0.23)
13
+ tty-spinner (~> 0.9)
14
+ tty-tree (~> 0.4)
15
+ yajl-ruby (>= 1.3)
16
+
17
+ GEM
18
+ remote: https://rubygems.org/
19
+ specs:
20
+ activemodel (7.1.5.1)
21
+ activesupport (= 7.1.5.1)
22
+ activerecord (7.1.5.1)
23
+ activemodel (= 7.1.5.1)
24
+ activesupport (= 7.1.5.1)
25
+ timeout (>= 0.4.0)
26
+ activesupport (7.1.5.1)
27
+ base64
28
+ benchmark (>= 0.3)
29
+ bigdecimal
30
+ concurrent-ruby (~> 1.0, >= 1.0.2)
31
+ connection_pool (>= 2.2.5)
32
+ drb
33
+ i18n (>= 1.6, < 2)
34
+ logger (>= 1.4.2)
35
+ minitest (>= 5.1)
36
+ mutex_m
37
+ securerandom (>= 0.3)
38
+ tzinfo (~> 2.0)
39
+ ast (2.4.3)
40
+ aws-eventstream (1.1.1)
41
+ aws-partitions (1.432.0)
42
+ aws-sdk-core (3.112.1)
43
+ aws-eventstream (~> 1, >= 1.0.2)
44
+ aws-partitions (~> 1, >= 1.239.0)
45
+ aws-sigv4 (~> 1.1)
46
+ jmespath (~> 1.0)
47
+ aws-sdk-kms (1.42.0)
48
+ aws-sdk-core (~> 3, >= 3.112.0)
49
+ aws-sigv4 (~> 1.1)
50
+ aws-sdk-s3 (1.90.0)
51
+ aws-sdk-core (~> 3, >= 3.112.0)
52
+ aws-sdk-kms (~> 1)
53
+ aws-sigv4 (~> 1.1)
54
+ aws-sigv4 (1.2.3)
55
+ aws-eventstream (~> 1, >= 1.0.2)
56
+ base64 (0.3.0)
57
+ benchmark (0.4.1)
58
+ bigdecimal (3.2.2)
59
+ byebug (11.1.3)
60
+ coderay (1.1.3)
61
+ concurrent-ruby (1.3.5)
62
+ connection_pool (2.5.3)
63
+ database_cleaner (2.1.0)
64
+ database_cleaner-active_record (>= 2, < 3)
65
+ database_cleaner-active_record (2.2.1)
66
+ activerecord (>= 5.a)
67
+ database_cleaner-core (~> 2.0.0)
68
+ database_cleaner-core (2.0.1)
69
+ diff-lcs (1.6.2)
70
+ docile (1.4.1)
71
+ drb (2.2.3)
72
+ factory_bot (6.4.5)
73
+ activesupport (>= 5.0.0)
74
+ i18n (1.14.7)
75
+ concurrent-ruby (~> 1.0)
76
+ jmespath (1.6.1)
77
+ json (2.12.2)
78
+ language_server-protocol (3.17.0.5)
79
+ lint_roller (1.1.0)
80
+ logger (1.7.0)
81
+ method_source (1.1.0)
82
+ mini_portile2 (2.8.9)
83
+ minitest (5.25.5)
84
+ mutex_m (0.3.0)
85
+ oj (3.16.11)
86
+ bigdecimal (>= 3.0)
87
+ ostruct (>= 0.2)
88
+ ostruct (0.6.1)
89
+ parallel (1.27.0)
90
+ parser (3.3.8.0)
91
+ ast (~> 2.4.1)
92
+ racc
93
+ pastel (0.8.0)
94
+ tty-color (~> 0.5)
95
+ prism (1.4.0)
96
+ pry (0.14.2)
97
+ coderay (~> 1.1)
98
+ method_source (~> 1.0)
99
+ pry-byebug (3.10.1)
100
+ byebug (~> 11.0)
101
+ pry (>= 0.13, < 0.15)
102
+ racc (1.8.1)
103
+ rainbow (3.1.1)
104
+ rake (13.3.0)
105
+ regexp_parser (2.10.0)
106
+ rspec (3.13.1)
107
+ rspec-core (~> 3.13.0)
108
+ rspec-expectations (~> 3.13.0)
109
+ rspec-mocks (~> 3.13.0)
110
+ rspec-core (3.13.4)
111
+ rspec-support (~> 3.13.0)
112
+ rspec-expectations (3.13.5)
113
+ diff-lcs (>= 1.2.0, < 2.0)
114
+ rspec-support (~> 3.13.0)
115
+ rspec-mocks (3.13.5)
116
+ diff-lcs (>= 1.2.0, < 2.0)
117
+ rspec-support (~> 3.13.0)
118
+ rspec-support (3.13.4)
119
+ rubocop (1.76.1)
120
+ json (~> 2.3)
121
+ language_server-protocol (~> 3.17.0.2)
122
+ lint_roller (~> 1.1.0)
123
+ parallel (~> 1.10)
124
+ parser (>= 3.3.0.2)
125
+ rainbow (>= 2.2.2, < 4.0)
126
+ regexp_parser (>= 2.9.3, < 3.0)
127
+ rubocop-ast (>= 1.45.0, < 2.0)
128
+ ruby-progressbar (~> 1.7)
129
+ unicode-display_width (>= 2.4.0, < 4.0)
130
+ rubocop-ast (1.45.1)
131
+ parser (>= 3.3.7.2)
132
+ prism (~> 1.4)
133
+ rubocop-capybara (2.22.1)
134
+ lint_roller (~> 1.1)
135
+ rubocop (~> 1.72, >= 1.72.1)
136
+ rubocop-factory_bot (2.27.1)
137
+ lint_roller (~> 1.1)
138
+ rubocop (~> 1.72, >= 1.72.1)
139
+ rubocop-rspec (2.31.0)
140
+ rubocop (~> 1.40)
141
+ rubocop-capybara (~> 2.17)
142
+ rubocop-factory_bot (~> 2.22)
143
+ rubocop-rspec_rails (~> 2.28)
144
+ rubocop-rspec_rails (2.29.1)
145
+ rubocop (~> 1.61)
146
+ ruby-progressbar (1.13.0)
147
+ securerandom (0.3.2)
148
+ simplecov (0.22.0)
149
+ docile (~> 1.1)
150
+ simplecov-html (~> 0.11)
151
+ simplecov_json_formatter (~> 0.1)
152
+ simplecov-html (0.13.1)
153
+ simplecov_json_formatter (0.1.4)
154
+ sqlite3 (1.7.3)
155
+ mini_portile2 (~> 2.8.0)
156
+ strings-ansi (0.2.0)
157
+ thor (1.3.2)
158
+ timeout (0.4.3)
159
+ tty-color (0.6.0)
160
+ tty-cursor (0.7.1)
161
+ tty-progressbar (0.18.3)
162
+ strings-ansi (~> 0.2)
163
+ tty-cursor (~> 0.7)
164
+ tty-screen (~> 0.8)
165
+ unicode-display_width (>= 1.6, < 3.0)
166
+ tty-prompt (0.23.1)
167
+ pastel (~> 0.8)
168
+ tty-reader (~> 0.8)
169
+ tty-reader (0.9.0)
170
+ tty-cursor (~> 0.7)
171
+ tty-screen (~> 0.8)
172
+ wisper (~> 2.0)
173
+ tty-screen (0.8.2)
174
+ tty-spinner (0.9.3)
175
+ tty-cursor (~> 0.7)
176
+ tty-tree (0.4.0)
177
+ tzinfo (2.0.6)
178
+ concurrent-ruby (~> 1.0)
179
+ unicode-display_width (2.6.0)
180
+ wisper (2.0.1)
181
+ yajl-ruby (1.4.3)
182
+
183
+ PLATFORMS
184
+ x86_64-darwin-23
185
+
186
+ DEPENDENCIES
187
+ activerecord-graph-extractor!
188
+ bundler (~> 2.0)
189
+ database_cleaner (~> 2.0)
190
+ factory_bot (~> 6.2)
191
+ pry (~> 0.14)
192
+ pry-byebug (~> 3.10)
193
+ rake (~> 13.0)
194
+ rspec (~> 3.0)
195
+ rubocop (~> 1.21)
196
+ rubocop-rspec (~> 2.25)
197
+ simplecov (~> 0.22)
198
+ sqlite3 (~> 1.4)
199
+
200
+ BUNDLED WITH
201
+ 2.4.22
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 ThredUP Engineering
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.