fast_schema_dumper 0.1.0 → 0.2.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 +4 -4
- data/README.md +24 -7
- data/lib/fast_schema_dumper/fast_dumper.rb +7 -1
- data/lib/fast_schema_dumper/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59d91cf2640474385f1f84f60c205fd9f42aa160e3c71fd8857d56f1ea7747d8
|
4
|
+
data.tar.gz: 30c873a8eb2cd833ec53126f1a6642a1b6f5f1f2d2d3495610f460773477b596
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bad68066eed1d18fdb2df665d0f17dfa07654ddeb5dec4d4ad2cf4292e7c73f0303f9ea969a3410c76589625551bc29b6dfdb68fb7f06bdb63c50365ff1c55c0
|
7
|
+
data.tar.gz: e9ea6b8ef54edfabb6ee4c24265a02ddc8544aefda247c3bf48e21bba8b5952b093f8cacfce31a765ba965809e1514a06233531e466950780a1c837a5f5cc7db
|
data/README.md
CHANGED
@@ -1,8 +1,29 @@
|
|
1
|
-
#
|
1
|
+
# fast_schema_dumper
|
2
2
|
|
3
|
-
|
3
|
+
A super fast alternative to ActiveRecord::SchemaDumper. Currently only MySQL is supported.
|
4
|
+
|
5
|
+
## Usage
|
6
|
+
|
7
|
+
### Ridgepole integration
|
8
|
+
|
9
|
+
Requiring `fast_schema_dumper/ridgepole` will overwrite `Ridgepole::Dumper.dump`, which will force Ridgepole to use fast_schema_dumper.
|
10
|
+
|
11
|
+
```
|
12
|
+
RUBYOPT='-rridgepole -rfast_schema_dumper' ridgepole ... --apply
|
13
|
+
```
|
14
|
+
|
15
|
+
#### Environment variables for Ridgepole
|
16
|
+
|
17
|
+
The Ridgepole integration is configurable via envionment variables.
|
18
|
+
|
19
|
+
- `FAST_SCHEMA_DUMPER_MODE`:
|
20
|
+
- `disabled`: Use the original ActiveRecord dumper
|
21
|
+
- `verify`: Run both dumpers and verify output matches (useful for testing)
|
22
|
+
- Any other value or unset: Use FastSchemaDumper (default)
|
23
|
+
- `FAST_SCHEMA_DUMPER_SUPPRESS_MESSAGE=1`: Suppress the warning message when FastSchemaDumper is enabled
|
24
|
+
|
25
|
+
I recommend using only fast_schema_dumper in local development environments, and configuring `FAST_SCHEMA_DUMPER_MODE=verify` in CI setups.
|
4
26
|
|
5
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/fast_schema_dumper`. To experiment with that code, run `bin/console` for an interactive prompt.
|
6
27
|
|
7
28
|
## Installation
|
8
29
|
|
@@ -18,10 +39,6 @@ If bundler is not being used to manage dependencies, install the gem by executin
|
|
18
39
|
gem install fast_schema_dumper
|
19
40
|
```
|
20
41
|
|
21
|
-
## Usage
|
22
|
-
|
23
|
-
TODO: Write usage instructions here
|
24
|
-
|
25
42
|
## Development
|
26
43
|
|
27
44
|
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
@@ -449,7 +449,13 @@ module FastSchemaDumper
|
|
449
449
|
end
|
450
450
|
|
451
451
|
unless order_hash.empty?
|
452
|
-
|
452
|
+
if index_data[:columns].size == 1
|
453
|
+
# For single column index, use simplified syntax
|
454
|
+
idx_def += ", order: :#{order_hash.values.first}"
|
455
|
+
else
|
456
|
+
# For compound index, use hash syntax
|
457
|
+
idx_def += ", order: { #{order_hash.map { |k, v| "#{k}: :#{v}" }.join(', ')} }"
|
458
|
+
end
|
453
459
|
end
|
454
460
|
end
|
455
461
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fast_schema_dumper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daisuke Aritomo
|
@@ -58,7 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
58
58
|
- !ruby/object:Gem::Version
|
59
59
|
version: '0'
|
60
60
|
requirements: []
|
61
|
-
rubygems_version: 3.
|
61
|
+
rubygems_version: 3.8.0.dev
|
62
62
|
specification_version: 4
|
63
63
|
summary: A fast alternative to ActiveRecord::SchemaDumper
|
64
64
|
test_files: []
|