pg_clip 0.1.1 → 0.1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e58e02c028c8baf1bf83e186ee9daa2559f9a703e93f91104cf627cfc6fb446c
4
- data.tar.gz: 3015c84c9bdc1d0d40225b8fdfc32cd21cf391bea861c98ab7be82bcbcf86a26
3
+ metadata.gz: e82278b583376e5666b32ebe2c32e1639ad7a47b52dae82562e3bb2938af2fd7
4
+ data.tar.gz: e9c606b803fb19c89c76af20d63016a9f749a2914922aa8d268906de8c760842
5
5
  SHA512:
6
- metadata.gz: 15df38988e709a3c8002c1e005b74ab63857b2dcaf7516bb844a2fafaf19fbb6621af2df324874d60c394b55ef1b7ecdc8318104f7cb43f9d67b8e87a509ad5d
7
- data.tar.gz: fb0b1c82c9ae9e852e6ad5a763cb3a47938d32296609f830b24ce5a03be7ed5119eb2a5466a87926eee2057caea576908148a2cfa6b49c01e07d54436c2904c6
6
+ metadata.gz: '0801b0b423d3c3d7c26fbd45b841837a545131709684969daf6c52139b675544176436e3401c54a6b91960ad12386f308fef5b8241ab812c06e3ba745699d929'
7
+ data.tar.gz: f82f6fc9554afe8c84d47af2a1f2bd8ce5b93ff7b820aebccdba6cfc61a6421a4befedabf84d3f20a95e27d86ded70cec2e1ba43f8f0fa6af1415cd7a7d1cca1
@@ -16,11 +16,18 @@ module PgClip
16
16
  def execute_query(query)
17
17
  connection.execute <<-SQL
18
18
  SET intervalstyle = 'iso_8601';
19
- WITH insight AS (#{query})
19
+ WITH insight AS (#{query}), stats AS (
20
+ SELECT
21
+ 1 AS page,
22
+ COUNT(*) AS total_count,
23
+ 1 AS total_pages
24
+ FROM insight
25
+ )
20
26
 
21
27
  SELECT
28
+ stats.*,
22
29
  row_to_json(insight) AS record
23
- FROM insight
30
+ FROM insight, stats
24
31
  SQL
25
32
  end
26
33
 
@@ -1,3 +1,3 @@
1
1
  module PgClip
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_clip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomasz Mazur
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-02-15 00:00:00.000000000 Z
11
+ date: 2019-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg