sequel_pg 1.6.17 → 1.6.18

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
  SHA1:
3
- metadata.gz: 41fd896c78d22b043d2544d1593fca2d48a02efe
4
- data.tar.gz: 566b1a460e4af2088e4f6aa223ea8e2ad815927d
3
+ metadata.gz: b9af8b932e28c1fba7a23ca7608c227be50a0896
4
+ data.tar.gz: c65775dc39943ef8f507f13ca7cc73a723cda98a
5
5
  SHA512:
6
- metadata.gz: 7c556a5e5db2f11691b2faeb934594c3b25f5cd93cf4c9d2c2c32182102e8bb2a64d71bb25cff84ec40f87bfb89a5e13b9bac584fe96de5fd5b4e4943353c2b5
7
- data.tar.gz: 95bca2c496c52da648384c0aad749e881c5bf85f9740298e85df76342cd57ec89cad717e25d5c72e457e4924d7d83822bddf72782780039a559a33990638f746
6
+ metadata.gz: fde42c5f10204facab45b5dfd30e39686854d9b93ac62afbcea80037558d349fae38fab978608ce593d2e62e6defa8c4b3892bbb1ad2f20d8745723de06b2356
7
+ data.tar.gz: b06f564b96261f1f04bb875a064e81956fe12d4c0d963cee958bfde0e259aa7f99bd38c00357b48509d41b500aeb0b3d1f50169c48fba7a1dd5a26fd2ea5e087
data/CHANGELOG CHANGED
@@ -1,6 +1,14 @@
1
+ === 1.6.18 (2017-04-27)
2
+
3
+ * Support logging of connection information in single row mode (jeremyevans)
4
+
5
+ * Check Sequel compatibility before overwriting methods, supported in Sequel 4.44.0+ (jeremyevans)
6
+
7
+ * Remove verbose mode warnings (jeremyevans)
8
+
1
9
  === 1.6.17 (2016-04-29)
2
10
 
3
- * Work with upcoming 4.34.0 release, supporting the duplicate_column_handler extension (jeremyevans)
11
+ * Work with upcoming 4.34.0 release, supporting the duplicate_column_handler extension (jeremyevans)
4
12
 
5
13
  === 1.6.16 (2016-04-11)
6
14
 
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010-2016 Jeremy Evans
1
+ Copyright (c) 2010-2017 Jeremy Evans
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to
data/README.rdoc CHANGED
@@ -7,7 +7,7 @@ faster (2-6x) than the pure ruby version that Sequel uses by default.
7
7
  == Real world difference
8
8
 
9
9
  The speed up that sequel_pg gives you depends on what you are
10
- selecting, but it should be noticable whenever many rows are selected.
10
+ selecting, but it should be noticeable whenever many rows are selected.
11
11
  Here's an example that shows the difference it makes on a couple of
12
12
  models:
13
13
 
@@ -48,8 +48,8 @@ with the following plugins that ship with Sequel:
48
48
 
49
49
  * class_table_inheritance
50
50
  * force_encoding
51
- * serializiation
52
- * single_table_interitance
51
+ * serialization
52
+ * single_table_inheritance
53
53
  * typecast_on_load
54
54
  * update_primary_key
55
55
 
@@ -154,9 +154,11 @@ sequel_pg has been tested on the following:
154
154
 
155
155
  * ruby 1.8.7
156
156
  * ruby 1.9.3
157
- * ruby 2.0.0
158
- * ruby 2.1.4
159
- * rbx 2.2.9
157
+ * ruby 2.0
158
+ * ruby 2.1
159
+ * ruby 2.2
160
+ * ruby 2.3
161
+ * ruby 2.4
160
162
 
161
163
  == Known Issues
162
164
 
@@ -1,3 +1,5 @@
1
+ #define SEQUEL_PG_VERSION_INTEGER 10618
2
+
1
3
  #include <string.h>
2
4
  #include <stdio.h>
3
5
  #include <math.h>
@@ -1018,6 +1020,17 @@ void Init_sequel_pg(void) {
1018
1020
  VALUE c, spg_Postgres;
1019
1021
  ID cg;
1020
1022
  cg = rb_intern("const_get");
1023
+
1024
+ spg_Sequel = rb_funcall(rb_cObject, cg, 1, rb_str_new2("Sequel"));
1025
+ spg_Postgres = rb_funcall(spg_Sequel, cg, 1, rb_str_new2("Postgres"));
1026
+
1027
+ if(rb_obj_respond_to(spg_Postgres, rb_intern("sequel_pg_version_supported?"), 0)) {
1028
+ if(!RTEST(rb_funcall(spg_Postgres, rb_intern("sequel_pg_version_supported?"), 1, INT2FIX(SEQUEL_PG_VERSION_INTEGER)))) {
1029
+ rb_warn("sequel_pg not loaded as it is not compatible with the Sequel version in use; install the latest version of sequel_pg or uninstall sequel_pg");
1030
+ return;
1031
+ }
1032
+ }
1033
+
1021
1034
  spg_id_new = rb_intern("new");
1022
1035
  spg_id_local = rb_intern("local");
1023
1036
  spg_id_year = rb_intern("year");
@@ -1060,12 +1073,10 @@ void Init_sequel_pg(void) {
1060
1073
  spg_sym__sequel_pg_type = ID2SYM(rb_intern("_sequel_pg_type"));
1061
1074
  spg_sym__sequel_pg_value = ID2SYM(rb_intern("_sequel_pg_value"));
1062
1075
 
1063
- spg_Sequel = rb_funcall(rb_cObject, cg, 1, rb_str_new2("Sequel"));
1064
1076
  spg_Blob = rb_funcall(rb_funcall(spg_Sequel, cg, 1, rb_str_new2("SQL")), cg, 1, rb_str_new2("Blob"));
1065
1077
  spg_SQLTime= rb_funcall(spg_Sequel, cg, 1, rb_str_new2("SQLTime"));
1066
1078
  spg_BigDecimal = rb_funcall(rb_cObject, cg, 1, rb_str_new2("BigDecimal"));
1067
1079
  spg_Date = rb_funcall(rb_cObject, cg, 1, rb_str_new2("Date"));
1068
- spg_Postgres = rb_funcall(spg_Sequel, cg, 1, rb_str_new2("Postgres"));
1069
1080
  spg_PGError = rb_funcall(rb_cObject, cg, 1, rb_str_new2("PGError"));
1070
1081
 
1071
1082
  spg_nan = rb_eval_string("0.0/0.0");
@@ -1083,7 +1094,7 @@ void Init_sequel_pg(void) {
1083
1094
  rb_global_variable(&spg_neg_inf);
1084
1095
 
1085
1096
  /* Check for 1.8-1.9.2 stdlib date that needs Rational for usec accuracy */
1086
- if (rb_eval_string("Date.today.instance_variable_get(:@ajd)") != Qnil) {
1097
+ if (rb_attr_get(rb_eval_string("Date.today"), rb_intern("@ajd")) != Qnil) {
1087
1098
  spg_id_Rational = rb_intern("Rational");
1088
1099
  }
1089
1100
  if (rb_eval_string("defined?(PG::TypeMapAllStrings)") != Qnil) {
@@ -1091,7 +1102,9 @@ void Init_sequel_pg(void) {
1091
1102
  }
1092
1103
 
1093
1104
  c = rb_funcall(spg_Postgres, cg, 1, rb_str_new2("Dataset"));
1105
+ rb_undef_method(c, "yield_hash_rows");
1094
1106
  rb_define_private_method(c, "yield_hash_rows", spg_yield_hash_rows, 2);
1107
+ rb_undef_method(c, "fetch_rows_set_cols");
1095
1108
  rb_define_private_method(c, "fetch_rows_set_cols", spg_fetch_rows_set_cols, 1);
1096
1109
 
1097
1110
  if (rb_eval_string("Sequel::Dataset.private_method_defined?(:columns=)") == Qtrue) {
@@ -73,16 +73,30 @@ module Sequel::Postgres::Streaming
73
73
 
74
74
  private
75
75
 
76
- # If using single row mode, send the query instead of executing it.
77
- def execute_query(sql, args)
78
- if @single_row_mode
79
- @single_row_mode = false
80
- @db.log_yield(sql, args){args ? send_query(sql, args) : send_query(sql)}
81
- set_single_row_mode
82
- block
83
- self
84
- else
85
- super
76
+ if Sequel::Database.instance_methods.map(&:to_s).include?('log_connection_yield')
77
+ # If using single row mode, send the query instead of executing it.
78
+ def execute_query(sql, args)
79
+ if @single_row_mode
80
+ @single_row_mode = false
81
+ @db.log_connection_yield(sql, self, args){args ? send_query(sql, args) : send_query(sql)}
82
+ set_single_row_mode
83
+ block
84
+ self
85
+ else
86
+ super
87
+ end
88
+ end
89
+ else
90
+ def execute_query(sql, args)
91
+ if @single_row_mode
92
+ @single_row_mode = false
93
+ @db.log_yield(sql, args){args ? send_query(sql, args) : send_query(sql)}
94
+ set_single_row_mode
95
+ block
96
+ self
97
+ else
98
+ super
99
+ end
86
100
  end
87
101
  end
88
102
  end
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.6.17
4
+ version: 1.6.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Evans
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-29 00:00:00.000000000 Z
11
+ date: 2017-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg
@@ -91,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
91
  version: '0'
92
92
  requirements: []
93
93
  rubyforge_project:
94
- rubygems_version: 2.5.1
94
+ rubygems_version: 2.6.11
95
95
  signing_key:
96
96
  specification_version: 4
97
97
  summary: Faster SELECTs when using Sequel with pg