pgdice 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +2 -2
- data/.ruby-version +1 -1
- data/CHANGELOG.md +5 -0
- data/README.md +10 -17
- data/SECURITY.md +15 -0
- data/lib/pgdice/version.rb +1 -1
- data/pgdice.gemspec +4 -4
- metadata +12 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad12a02674afc68542e4b8038aaddcfb107eba52bc208f700ef57e880783d100
|
4
|
+
data.tar.gz: 6d384e71518d19b9e8319d6d84632ded6b3de0bcdd4fb6fa2cef80d837fc100d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8880202263ce06487635f87118d82b723405f465a5d39f087310961e965a553b4510088bc11f23d12fb37b76faf1bc0e8d5a706b26d28ad2afcb10111cbf07c8
|
7
|
+
data.tar.gz: a3c14f23d6b52a991f7997a9d887877e58b93e8c0b8717e65ea42ade699eae5fbfd1642eea788ddcc8eefe9d9dd01a12cff540772e1d2f69281119fcb6a73cad
|
data/.circleci/config.yml
CHANGED
@@ -6,13 +6,13 @@ version: 2
|
|
6
6
|
defaults: &defaults
|
7
7
|
working_directory: ~/repo
|
8
8
|
docker:
|
9
|
-
- image: circleci/ruby:2.
|
9
|
+
- image: circleci/ruby:2.6.6
|
10
10
|
environment:
|
11
11
|
DATABASE_HOST: 127.0.0.1
|
12
12
|
DATABASE_USERNAME: pgdice
|
13
13
|
PGDICE_LOG_TARGET: STDOUT
|
14
14
|
|
15
|
-
- image: circleci/postgres:
|
15
|
+
- image: circleci/postgres:12.1-alpine-ram
|
16
16
|
environment:
|
17
17
|
POSTGRES_USER: pgdice
|
18
18
|
POSTGRES_DB: pgdice_test
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-2.
|
1
|
+
ruby-2.6.6
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,11 @@
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
4
4
|
|
5
|
+
## [v1.0.1] : 2020-01-31
|
6
|
+
### Changes
|
7
|
+
- Added better examples/docs.
|
8
|
+
- Bump `pg` to `~> 1.2.2`
|
9
|
+
|
5
10
|
## [v0.4.3] : 2019-04-23
|
6
11
|
### Changes
|
7
12
|
- Fix #31 where the new connection retry code was eagerly initializing the logger
|
data/README.md
CHANGED
@@ -12,6 +12,9 @@ PgDice is a utility for creating and maintaining partitioned database tables tha
|
|
12
12
|
PgDice is intended to be used by scheduled background jobs in frameworks like [Sidekiq](https://github.com/mperham/sidekiq)
|
13
13
|
where logging and clear exception messages are crucial.
|
14
14
|
|
15
|
+
# Maintenance status
|
16
|
+
|
17
|
+
This project is stable and used daily in production.
|
15
18
|
|
16
19
|
# Installation
|
17
20
|
|
@@ -49,6 +52,7 @@ PgDice.configure do |config|
|
|
49
52
|
|
50
53
|
# Set a config file or build the tables manually
|
51
54
|
config.config_file = Rails.root.join('config', 'pgdice.yml') # If you are using rails, else provide the absolute path.
|
55
|
+
config.config_file = Rails.root.join('config', 'pgdice.yml') # If you are using rails, else provide the absolute path.
|
52
56
|
# and/or
|
53
57
|
config.approved_tables = PgDice::ApprovedTables.new(
|
54
58
|
PgDice::Table.new(table_name: 'comments', past: 90, future: 7, period: 'day'),
|
@@ -57,7 +61,6 @@ PgDice.configure do |config|
|
|
57
61
|
end
|
58
62
|
```
|
59
63
|
|
60
|
-
|
61
64
|
### Configuration Parameters
|
62
65
|
|
63
66
|
- `database_url` - **Required**: The postgres database url to connect to.
|
@@ -167,7 +170,6 @@ PgDice.undo_partitioning!('comments')
|
|
167
170
|
This method will revert the changes made by partitioning a table. Don't rely on this
|
168
171
|
in production if you mess up; you need to test everything thoroughly.
|
169
172
|
|
170
|
-
|
171
173
|
## Maintaining partitioned tables
|
172
174
|
|
173
175
|
### Adding more tables
|
@@ -184,7 +186,6 @@ PgDice.add_new_partitions('comments')
|
|
184
186
|
that the partitioned table was defined with.
|
185
187
|
- The example `comments` table we have been using was configured to always keep `7` future partitions above.
|
186
188
|
|
187
|
-
|
188
189
|
### Listing droppable partitions
|
189
190
|
|
190
191
|
Sometimes you just want to know what's out there and if there are tables ready to be dropped.
|
@@ -201,7 +202,6 @@ PgDice.list_droppable_partitions_by_batch_size('comments')
|
|
201
202
|
|
202
203
|
This method will show partitions that are within the configured `batch_size`.
|
203
204
|
|
204
|
-
|
205
205
|
#### Notes on `list_droppable_partitions`
|
206
206
|
|
207
207
|
- This method uses the `past` value from the `PgDice::Table` to determine which tables are eligible for dropping.
|
@@ -223,7 +223,6 @@ PgDice.drop_old_partitions('comments')
|
|
223
223
|
for the `PgDice::Table`.
|
224
224
|
- The example `comments` table has been configured with `past: 90` tables.
|
225
225
|
So if there were 100 tables older than `today` it would drop up to `batch_size` tables.
|
226
|
-
|
227
226
|
|
228
227
|
# Validation
|
229
228
|
|
@@ -256,7 +255,6 @@ PgDice.approved_tables
|
|
256
255
|
|
257
256
|
The [ApprovedTables](lib/pgdice/approved_tables.rb) object responds to the most common enumerable methods.
|
258
257
|
|
259
|
-
|
260
258
|
# Miscellaneous Notes
|
261
259
|
|
262
260
|
All methods for `PgDice` take a hash which will override whatever values would have been automatically supplied.
|
@@ -297,9 +295,7 @@ you through what is going on.
|
|
297
295
|
|
298
296
|
1. Full `PG::Connection` support (no more database URLs).
|
299
297
|
1. Non time-range based partitioning. [PgParty](https://github.com/rkrage/pg_party) might be a good option!
|
300
|
-
|
301
|
-
|
302
|
-
|
298
|
+
1. Hourly partitioning
|
303
299
|
|
304
300
|
# Development
|
305
301
|
|
@@ -308,7 +304,6 @@ You can also run `bin/console` for an interactive prompt that will allow you to
|
|
308
304
|
|
309
305
|
To install this gem onto your local machine, run `bundle exec rake install`.
|
310
306
|
|
311
|
-
|
312
307
|
## Running tests
|
313
308
|
|
314
309
|
You're going to need to have postgres 10 or greater installed.
|
@@ -319,7 +314,6 @@ Run the following commands from your terminal. Don't run these on anything but a
|
|
319
314
|
1. `createdb pgdice_test`
|
320
315
|
1. Now you can run the tests via `guard` or `rake test`
|
321
316
|
|
322
|
-
|
323
317
|
## Contributing
|
324
318
|
|
325
319
|
Bug reports and pull requests are welcome on GitHub at
|
@@ -327,19 +321,18 @@ Bug reports and pull requests are welcome on GitHub at
|
|
327
321
|
to be a safe, welcoming space for collaboration, and contributors are expected to adhere to
|
328
322
|
the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
329
323
|
|
330
|
-
|
331
324
|
# License
|
332
325
|
|
333
326
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
334
327
|
|
335
328
|
# Disclaimer
|
336
329
|
|
337
|
-
There are some features in this gem which allow you to drop database tables
|
330
|
+
There are some features in this gem which allow you to drop database tables, due to the dangerous nature of
|
331
|
+
dropping database tables, please ensure you have a tested and working backup and restore strategy.
|
338
332
|
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
maintainers and any affiliated parties CANNOT BE HELD LIABLE FOR DATA LOSS OR LOSSES OF ANY KIND.
|
333
|
+
THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED.
|
334
|
+
By using this software you agree that the creator, maintainers, and any affiliated parties
|
335
|
+
CANNOT BE HELD LIABLE FOR DATA LOSS OR LOSSES OF ANY KIND.
|
343
336
|
|
344
337
|
See the [LICENSE](LICENSE) for more information.
|
345
338
|
|
data/SECURITY.md
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# Security Policy
|
2
|
+
|
3
|
+
## Supported Versions
|
4
|
+
|
5
|
+
The versions here are currently supported for security patches.
|
6
|
+
|
7
|
+
| Version | Supported |
|
8
|
+
| ------- | ------------------ |
|
9
|
+
| latest | :white_check_mark: |
|
10
|
+
| < 1.0 | :x: |
|
11
|
+
|
12
|
+
|
13
|
+
## Reporting a Vulnerability
|
14
|
+
|
15
|
+
Please open a new issue
|
data/lib/pgdice/version.rb
CHANGED
data/pgdice.gemspec
CHANGED
@@ -25,18 +25,18 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.require_paths = ['lib']
|
26
26
|
|
27
27
|
# Locked because we depend on internal behavior for table commenting
|
28
|
-
spec.add_runtime_dependency 'pg', '~> 1.2.
|
29
|
-
spec.add_runtime_dependency 'pgslice', '0.4.
|
28
|
+
spec.add_runtime_dependency 'pg', '~> 1.2.3', '>= 1.1.0'
|
29
|
+
spec.add_runtime_dependency 'pgslice', '0.4.6'
|
30
30
|
|
31
31
|
spec.add_development_dependency 'bundler', '~> 1.16', '>= 1.16'
|
32
32
|
spec.add_development_dependency 'coveralls', '~> 0.8.22', '>= 0.8.22'
|
33
|
-
spec.add_development_dependency 'guard', '~> 2.
|
33
|
+
spec.add_development_dependency 'guard', '~> 2.16.2', '>= 2.14.2'
|
34
34
|
spec.add_development_dependency 'guard-minitest', '~> 2.4.6', '>= 2.4.6'
|
35
35
|
spec.add_development_dependency 'guard-rubocop', '~> 1.3.0', '>= 1.3.0'
|
36
36
|
spec.add_development_dependency 'guard-shell', '~> 0.7.1', '>= 0.7.1'
|
37
37
|
spec.add_development_dependency 'minitest', '~> 5.0', '>= 5.0'
|
38
38
|
spec.add_development_dependency 'minitest-ci', '~> 3.4.0', '>= 3.4.0'
|
39
|
-
spec.add_development_dependency 'minitest-reporters', '~> 1.
|
39
|
+
spec.add_development_dependency 'minitest-reporters', '~> 1.4.2', '>= 1.3.4'
|
40
40
|
spec.add_development_dependency 'rake', '~> 10.0', '>= 10.0'
|
41
41
|
spec.add_development_dependency 'rubocop', '0.71'
|
42
42
|
spec.add_development_dependency 'simplecov', '~> 0.16.1', '>= 0.16.1'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pgdice
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Newell
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: 1.1.0
|
20
20
|
- - "~>"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 1.2.
|
22
|
+
version: 1.2.3
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,21 +29,21 @@ dependencies:
|
|
29
29
|
version: 1.1.0
|
30
30
|
- - "~>"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 1.2.
|
32
|
+
version: 1.2.3
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: pgslice
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
37
|
- - '='
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: 0.4.
|
39
|
+
version: 0.4.6
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - '='
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: 0.4.
|
46
|
+
version: 0.4.6
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: bundler
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -93,7 +93,7 @@ dependencies:
|
|
93
93
|
version: 2.14.2
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 2.
|
96
|
+
version: 2.16.2
|
97
97
|
type: :development
|
98
98
|
prerelease: false
|
99
99
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -103,7 +103,7 @@ dependencies:
|
|
103
103
|
version: 2.14.2
|
104
104
|
- - "~>"
|
105
105
|
- !ruby/object:Gem::Version
|
106
|
-
version: 2.
|
106
|
+
version: 2.16.2
|
107
107
|
- !ruby/object:Gem::Dependency
|
108
108
|
name: guard-minitest
|
109
109
|
requirement: !ruby/object:Gem::Requirement
|
@@ -213,7 +213,7 @@ dependencies:
|
|
213
213
|
version: 1.3.4
|
214
214
|
- - "~>"
|
215
215
|
- !ruby/object:Gem::Version
|
216
|
-
version: 1.
|
216
|
+
version: 1.4.2
|
217
217
|
type: :development
|
218
218
|
prerelease: false
|
219
219
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -223,7 +223,7 @@ dependencies:
|
|
223
223
|
version: 1.3.4
|
224
224
|
- - "~>"
|
225
225
|
- !ruby/object:Gem::Version
|
226
|
-
version: 1.
|
226
|
+
version: 1.4.2
|
227
227
|
- !ruby/object:Gem::Dependency
|
228
228
|
name: rake
|
229
229
|
requirement: !ruby/object:Gem::Requirement
|
@@ -302,6 +302,7 @@ files:
|
|
302
302
|
- LICENSE
|
303
303
|
- README.md
|
304
304
|
- Rakefile
|
305
|
+
- SECURITY.md
|
305
306
|
- bin/_guard-core
|
306
307
|
- bin/console
|
307
308
|
- bin/guard
|
@@ -368,7 +369,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
368
369
|
- !ruby/object:Gem::Version
|
369
370
|
version: '0'
|
370
371
|
requirements: []
|
371
|
-
rubygems_version: 3.0.
|
372
|
+
rubygems_version: 3.0.8
|
372
373
|
signing_key:
|
373
374
|
specification_version: 4
|
374
375
|
summary: Postgres table partitioning with a Ruby API!
|