pg_column_byte_packer 1.2.0 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +4 -2
- data/.ruby-version +1 -1
- data/Appraisals +16 -8
- data/README.md +4 -2
- data/gemfiles/{rails_5.1.gemfile → rails_7.0.gemfile} +1 -1
- data/gemfiles/{rails_5.2.gemfile → rails_7.1.gemfile} +1 -1
- data/gemfiles/rails_7.2.gemfile +7 -0
- data/gemfiles/rails_8.0.gemfile +7 -0
- data/lib/pg_column_byte_packer/version.rb +1 -1
- data/lib/pg_column_byte_packer.rb +7 -3
- data/pg_column_byte_packer.gemspec +2 -2
- metadata +13 -12
- data/.travis.yml +0 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af8db7dc311f4670fd3b1db34491a95b6832d9e8c2b6bdbd7a5f6253bffbcb29
|
4
|
+
data.tar.gz: a95293debca7a6e9ac95abbf37469ac2e854886f3164d94279c55b56150203f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fec9f947b1f8cd6ef97f4519d316d19627ddd1c00437260fafb57fd58d9e074e7c035caad8cc1ebbd7bf1648620dfca6ec39e805ccd5d3d4b41688383363de3d
|
7
|
+
data.tar.gz: f002ff351a5b32fd3e143acaccc2106251d05854cb9b4a0ddb905b6526dfc1b696a20e478566dc582e607ab1dd380fe807040e65024b5616033eb200d34b3d24
|
data/.github/workflows/ci.yml
CHANGED
@@ -11,10 +11,12 @@ jobs:
|
|
11
11
|
- 12
|
12
12
|
- 13
|
13
13
|
gemfile:
|
14
|
-
- rails_5.1
|
15
|
-
- rails_5.2
|
16
14
|
- rails_6.0
|
17
15
|
- rails_6.1
|
16
|
+
- rails_7.0
|
17
|
+
- rails_7.1
|
18
|
+
- rails_7.2
|
19
|
+
- rails_8.0
|
18
20
|
name: PostgreSQL ${{ matrix.pg }}
|
19
21
|
runs-on: ubuntu-latest
|
20
22
|
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-
|
1
|
+
ruby-3.3
|
data/Appraisals
CHANGED
@@ -1,11 +1,3 @@
|
|
1
|
-
appraise "rails-5.1" do
|
2
|
-
gem "activerecord", "~> 5.1.0"
|
3
|
-
end
|
4
|
-
|
5
|
-
appraise "rails-5.2" do
|
6
|
-
gem "activerecord", "~> 5.2.0"
|
7
|
-
end
|
8
|
-
|
9
1
|
appraise "rails-6.0" do
|
10
2
|
gem "activerecord", "~> 6.0.0"
|
11
3
|
end
|
@@ -13,3 +5,19 @@ end
|
|
13
5
|
appraise "rails-6.1" do
|
14
6
|
gem "activerecord", "~> 6.1.0"
|
15
7
|
end
|
8
|
+
|
9
|
+
appraise "rails-7.0" do
|
10
|
+
gem "activerecord", "~> 7.0.0"
|
11
|
+
end
|
12
|
+
|
13
|
+
appraise "rails-7.1" do
|
14
|
+
gem "activerecord", "~> 7.1"
|
15
|
+
end
|
16
|
+
|
17
|
+
appraise "rails-7.2" do
|
18
|
+
gem "activerecord", "~> 7.2"
|
19
|
+
end
|
20
|
+
|
21
|
+
appraise "rails-8.0" do
|
22
|
+
gem "activerecord", "~> 8.0"
|
23
|
+
end
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# PostgreSQL Column Byte Packer
|
2
2
|
|
3
|
-
[![Build Status](https://
|
3
|
+
[![Build Status](https://github.com/braintree/pg_column_byte_packer/actions/workflows/ci.yml/badge.svg)](https://github.com/braintree/pg_column_byte_packer/actions/workflows/ci.yml?query=branch%3Amaster+)
|
4
4
|
|
5
5
|
tl;dr: Provides facilities for laying out table column order to optimize for disk space usage both in ActiveRecord migrations and `pg_dump` generated SQL schema files. The general idea and relevant PostgreSQL internals are described in [On Rocks and Sand](https://www.2ndquadrant.com/en/blog/on-rocks-and-sand/).
|
6
6
|
|
@@ -51,7 +51,9 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
|
51
51
|
|
52
52
|
Running tests will automatically create a test database in the locally running Postgres server. You can find the connection parameters in `spec/spec_helper.rb`, but setting the environment variables `PGHOST`, `PGPORT`, `PGUSER`, and `PGPASSWORD` will override the defaults.
|
53
53
|
|
54
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). To ignore local changes (say to `.ruby-version`) you can do `rake build release:source_control_push release:rubygem_push`.
|
54
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, commit the change, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). To ignore local changes (say to `.ruby-version`) you can do `rake build release:source_control_push release:rubygem_push`.
|
55
|
+
|
56
|
+
Note: if while releasing the gem you get the error ``Your rubygems.org credentials aren't set. Run `gem push` to set them.`` you can more simply run `gem signin`.
|
55
57
|
|
56
58
|
## License
|
57
59
|
|
@@ -74,8 +74,8 @@ module PgColumnBytePacker
|
|
74
74
|
|
75
75
|
# Ignore array designations. This seems like something we could
|
76
76
|
# so with the parsing above, and we could, and, in fact, that
|
77
|
-
# would also almost
|
78
|
-
# ActiveRecord
|
77
|
+
# would also almost certainly allow us to rip out most of the
|
78
|
+
# ActiveRecord generated alias type name matching below, but
|
79
79
|
# it would also mean a more thorough refactor below for types
|
80
80
|
# with size designations (e.g., when ActiveRecord generates
|
81
81
|
# "float(23)"). So we use this simple regex cleanup for now.
|
@@ -84,7 +84,7 @@ module PgColumnBytePacker
|
|
84
84
|
# Sort out the alignment. Most of the type name matching is to
|
85
85
|
# support the naming variants that ActiveRecord generates (often
|
86
86
|
# they're aliases, like "integer", for which PostgreSQL internally
|
87
|
-
# has a different canonical name
|
87
|
+
# has a different canonical name: "int4"). There are also
|
88
88
|
# a few cases we have to handle where the output from pgdump
|
89
89
|
# doesn't match the canonical name in pg_type; e.g., "float8" is
|
90
90
|
# canonical, but pgdump outputs "double precision".
|
@@ -194,6 +194,7 @@ module PgColumnBytePacker
|
|
194
194
|
end
|
195
195
|
|
196
196
|
if typtype == "e"
|
197
|
+
# Enum
|
197
198
|
4
|
198
199
|
else
|
199
200
|
case typalign
|
@@ -203,10 +204,13 @@ module PgColumnBytePacker
|
|
203
204
|
# column definition) but require no alignment.
|
204
205
|
1
|
205
206
|
when "s"
|
207
|
+
# Short alignment
|
206
208
|
2
|
207
209
|
when "i"
|
210
|
+
# Int alingment
|
208
211
|
4
|
209
212
|
when "d"
|
213
|
+
# Double alignment
|
210
214
|
8
|
211
215
|
else
|
212
216
|
1
|
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
24
|
spec.require_paths = ["lib"]
|
25
25
|
|
26
|
-
spec.add_development_dependency "rake"
|
26
|
+
spec.add_development_dependency "rake", ">= 12.3.3"
|
27
27
|
spec.add_development_dependency "rspec"
|
28
28
|
spec.add_development_dependency "relation_to_struct"
|
29
29
|
spec.add_development_dependency "db-query-matchers"
|
@@ -32,6 +32,6 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.add_development_dependency "appraisal"
|
33
33
|
|
34
34
|
spec.add_dependency "pg"
|
35
|
-
spec.add_dependency "activerecord", ">=
|
35
|
+
spec.add_dependency "activerecord", ">= 6.0", "< 8.1"
|
36
36
|
spec.add_dependency "pg_query", "< 2.0"
|
37
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pg_column_byte_packer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jcoleman
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 12.3.3
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 12.3.3
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,20 +128,20 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - ">="
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: '
|
131
|
+
version: '6.0'
|
132
132
|
- - "<"
|
133
133
|
- !ruby/object:Gem::Version
|
134
|
-
version: '
|
134
|
+
version: '8.1'
|
135
135
|
type: :runtime
|
136
136
|
prerelease: false
|
137
137
|
version_requirements: !ruby/object:Gem::Requirement
|
138
138
|
requirements:
|
139
139
|
- - ">="
|
140
140
|
- !ruby/object:Gem::Version
|
141
|
-
version: '
|
141
|
+
version: '6.0'
|
142
142
|
- - "<"
|
143
143
|
- !ruby/object:Gem::Version
|
144
|
-
version: '
|
144
|
+
version: '8.1'
|
145
145
|
- !ruby/object:Gem::Dependency
|
146
146
|
name: pg_query
|
147
147
|
requirement: !ruby/object:Gem::Requirement
|
@@ -168,7 +168,6 @@ files:
|
|
168
168
|
- ".pryrc"
|
169
169
|
- ".rspec"
|
170
170
|
- ".ruby-version"
|
171
|
-
- ".travis.yml"
|
172
171
|
- Appraisals
|
173
172
|
- Gemfile
|
174
173
|
- LICENSE.txt
|
@@ -177,10 +176,12 @@ files:
|
|
177
176
|
- bin/console
|
178
177
|
- bin/setup
|
179
178
|
- gemfiles/.bundle/config
|
180
|
-
- gemfiles/rails_5.1.gemfile
|
181
|
-
- gemfiles/rails_5.2.gemfile
|
182
179
|
- gemfiles/rails_6.0.gemfile
|
183
180
|
- gemfiles/rails_6.1.gemfile
|
181
|
+
- gemfiles/rails_7.0.gemfile
|
182
|
+
- gemfiles/rails_7.1.gemfile
|
183
|
+
- gemfiles/rails_7.2.gemfile
|
184
|
+
- gemfiles/rails_8.0.gemfile
|
184
185
|
- lib/pg_column_byte_packer.rb
|
185
186
|
- lib/pg_column_byte_packer/pg_dump.rb
|
186
187
|
- lib/pg_column_byte_packer/schema_statements.rb
|
@@ -205,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
205
206
|
- !ruby/object:Gem::Version
|
206
207
|
version: '0'
|
207
208
|
requirements: []
|
208
|
-
rubygems_version: 3.
|
209
|
+
rubygems_version: 3.2.5
|
209
210
|
signing_key:
|
210
211
|
specification_version: 4
|
211
212
|
summary: Auto-order table columns for optimize disk space usage
|
data/.travis.yml
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
sudo: false
|
2
|
-
language: ruby
|
3
|
-
rvm:
|
4
|
-
- 2.5
|
5
|
-
- 2.7
|
6
|
-
env:
|
7
|
-
global:
|
8
|
-
- PGPORT: "5433"
|
9
|
-
jobs:
|
10
|
-
- PGVERSION: "9.6"
|
11
|
-
- PGVERSION: "10"
|
12
|
-
- PGVERSION: "11"
|
13
|
-
- PGVERSION: "12"
|
14
|
-
- PGVERSION: "13"
|
15
|
-
services:
|
16
|
-
- postgresql
|
17
|
-
before_install:
|
18
|
-
- "for CLUSTER_VERSION in $(pg_lsclusters -h | cut -d' ' -f1); do sudo pg_dropcluster $CLUSTER_VERSION main --stop || true; sudo apt-get remove postgresql-client-$CLUSTER_VERSION postgresql-client-common || true; done"
|
19
|
-
- sudo apt-get update
|
20
|
-
- sudo apt-get -y install postgresql-$PGVERSION postgresql-server-dev-$PGVERSION postgresql-contrib-$PGVERSION postgresql-client-$PGVERSION postgresql-client-common
|
21
|
-
- sudo pg_dropcluster $PGVERSION main --stop || true
|
22
|
-
- sudo pg_createcluster $PGVERSION main -D /var/ramfs/postgresql/$PGVERSION/main -- --auth=trust
|
23
|
-
- sudo pg_ctlcluster start $PGVERSION main
|
24
|
-
- gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true
|
25
|
-
- gem install bundler
|
26
|
-
gemfile:
|
27
|
-
- gemfiles/rails_5.1.gemfile
|
28
|
-
- gemfiles/rails_5.2.gemfile
|
29
|
-
- gemfiles/rails_6.0.gemfile
|
30
|
-
- gemfiles/rails_6.1.gemfile
|
31
|
-
script: "bundle exec rake spec"
|