sequel_pg 1.11.0 → 1.12.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c587158ff9ea71f6a0ce019384c317b03b8c1a9c6027f363502e98f148b4a958
4
- data.tar.gz: ad74cf362d21fe64409be4b29536709c5d6d6dbabe3a248a3cad5da5f282124f
3
+ metadata.gz: 96c16261374320f8dfec253707af53c799ea5a9f34110a0cfe1dc3c909651aab
4
+ data.tar.gz: dafd8b441554f5befa9e77cb6ee0c7e743054f0fbf481a6ba2885fec5ea7e01c
5
5
  SHA512:
6
- metadata.gz: 39fb59374fe67630cea51820851b380f9537ef6769599ee43581855eb99e70c5251d03c70134a0512ad6ce36bc127704dcf152a2113de1461deb2839e19830c5
7
- data.tar.gz: 470e31d71b43e3cad932cad0838805047d8d69013795a28d29b0099460a7a285ae5caae6a3e3950d61b80e30d2668cbf398fdc0dce1e16a1f970226e48c69cdb
6
+ metadata.gz: e8fc58d763a43e1ef56f51eaea4d835ffc1c6acdb28d1e40914c90a5537d4f25e9aaf1fb927559964c17a7c1889d359a7ebfd058e6c15484eaf965cd0ff93e2d
7
+ data.tar.gz: 8de13c929838df473df991880fcb87180471c6476dcfe6429f16679d3d4af4b815c7fdb33f61a2b2d08451127424ca7a0d52286b260d84d885add6dd3c6e834d
data/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ === 1.12.0 (2019-03-01)
2
+
3
+ * Allow Dataset#paged_each to be called without a block when using streaming (jeremyevans)
4
+
5
+ * Freeze ruby strings used as temporary buffers for parsing arrays (jeremyevans)
6
+
1
7
  === 1.11.0 (2018-07-09)
2
8
 
3
9
  * Set encoding correctly for hash symbol keys (jeremyevans)
@@ -1,4 +1,4 @@
1
- #define SEQUEL_PG_VERSION_INTEGER 11100
1
+ #define SEQUEL_PG_VERSION_INTEGER 11200
2
2
 
3
3
  #include <string.h>
4
4
  #include <stdio.h>
@@ -391,10 +391,14 @@ static VALUE parse_pg_array(VALUE self, VALUE pg_array_string, VALUE converter)
391
391
  return ary;
392
392
  }
393
393
 
394
+ ary = rb_str_buf_new(array_string_length);
395
+ rb_str_set_len(ary, array_string_length);
396
+ rb_obj_freeze(ary);
397
+
394
398
  return read_array(&index,
395
399
  c_pg_array_string,
396
400
  array_string_length,
397
- rb_str_buf_new(array_string_length),
401
+ ary,
398
402
  converter,
399
403
  enc_get_index(pg_array_string),
400
404
  0,
@@ -936,6 +940,7 @@ static VALUE spg__array_col_value(char *v, size_t length, VALUE converter, int e
936
940
 
937
941
  static VALUE spg_array_value(char *c_pg_array_string, int array_string_length, VALUE converter, int enc_index, int oid, VALUE self, VALUE array_type) {
938
942
  int index = 1;
943
+ VALUE buf;
939
944
  VALUE args[2];
940
945
  args[1] = array_type;
941
946
 
@@ -943,7 +948,10 @@ static VALUE spg_array_value(char *c_pg_array_string, int array_string_length, V
943
948
  return rb_class_new_instance(2, args, spg_PGArray);
944
949
  }
945
950
 
946
- args[0] = read_array(&index, c_pg_array_string, array_string_length, rb_str_buf_new(array_string_length), converter, enc_index, oid, self);
951
+ buf = rb_str_buf_new(array_string_length);
952
+ rb_str_set_len(buf, array_string_length);
953
+ rb_obj_freeze(buf);
954
+ args[0] = read_array(&index, c_pg_array_string, array_string_length, buf, converter, enc_index, oid, self);
947
955
  return rb_class_new_instance(2, args, spg_PGArray);
948
956
  }
949
957
 
@@ -119,6 +119,9 @@ module Sequel::Postgres::Streaming
119
119
 
120
120
  # Use streaming to implement paging.
121
121
  def paged_each(opts=Sequel::OPTS, &block)
122
+ unless block_given?
123
+ return enum_for(:paged_each, opts)
124
+ end
122
125
  stream.each(&block)
123
126
  end
124
127
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequel_pg
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.0
4
+ version: 1.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Evans
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-09 00:00:00.000000000 Z
11
+ date: 2019-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg
@@ -90,8 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
90
  - !ruby/object:Gem::Version
91
91
  version: '0'
92
92
  requirements: []
93
- rubyforge_project:
94
- rubygems_version: 2.7.6
93
+ rubygems_version: 3.0.1
95
94
  signing_key:
96
95
  specification_version: 4
97
96
  summary: Faster SELECTs when using Sequel with pg