sequel_pg 1.20.0 → 1.21.0

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: 14718a7aa7ca80b5952b679a8bbcd29bc3b381c80ac8df005d864f34a6c0da45
4
- data.tar.gz: 816ea1b4bed0b6292c4d30e02954c1bc436af0126eda4b70bc177cf634cc7702
3
+ metadata.gz: c8535e9ad79f8a076d5438919bfbebbe54100d62cf4eace2de5d94bba41065cc
4
+ data.tar.gz: f56ead135996a48a2e0957178ca2de366e852bf67c382759280d05d00750ab2e
5
5
  SHA512:
6
- metadata.gz: f79306d514d96bcfefea76f9afcebc3efcb67f0a8ff6ff0ceaba9b00c767277be24190357d344c3301f7d5aded60991b11ecbd72d2e1684eec4b4f278695f37e
7
- data.tar.gz: 2214385a1e511c1c408aa1800ef5a0abdbc6fccaa963ac064a343dec6a99b176ed134aa007922803c7c492b687215a2a7fb545ab52bfea0030af53a46d20d1eb
6
+ metadata.gz: a93e5990a83536fd97e631dbaf742869f38466cf5ab7a4558fc74f2dc680a2f2dee93f9197411c512a08e7cc4f0c03b361d86e3c619a4b167d8e304414ae4ca2
7
+ data.tar.gz: adb187821424bd4c9ec9a45ffd555a99faf3b7f9f6c9d83b10df0d08adef48e3671b0423e471cdb5dad771458c453b0e39d9255e44f87940cea15fb955dd906f
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ === 1.21.0 (2026-12-01)
2
+
3
+ * Use the proleptic gregorian calendar for Date and DateTime (JonathanTron) (#69)
4
+
1
5
  === 1.20.0 (2026-09-06)
2
6
 
3
7
  * Skip query canceling on Ruby < 2.4 (jeremyevans)
data/Rakefile CHANGED
@@ -38,5 +38,6 @@ desc "Run CI tests"
38
38
  task :spec_ci=>:compile do
39
39
  ENV['SEQUEL_PG_SPEC_URL'] = ENV['SEQUEL_POSTGRES_URL'] = "postgres://localhost/?user=postgres&password=postgres"
40
40
  sh %'#{FileUtils::RUBY} -I lib -I sequel/lib spec/sequel_pg_spec.rb'
41
+ next if RUBY_VERSION < '2'
41
42
  sh %'cd sequel && #{FileUtils::RUBY} -I lib -I ../lib spec/adapter_spec.rb postgres'
42
43
  end
@@ -1,4 +1,4 @@
1
- #define SEQUEL_PG_VERSION_INTEGER 12000
1
+ #define SEQUEL_PG_VERSION_INTEGER 12100
2
2
 
3
3
  #include <string.h>
4
4
  #include <stdio.h>
@@ -80,6 +80,8 @@
80
80
  #define SPG_YIELD_ALL 22
81
81
  #define SPG_YIELD_ALL_MODEL 23
82
82
 
83
+ #define SPG_DATE_GREGORIAN spg_neg_inf
84
+
83
85
  /* External functions defined by ruby-pg */
84
86
  PGconn* pg_get_pgconn(VALUE);
85
87
  PGresult* pgresult_get(VALUE);
@@ -542,7 +544,7 @@ static VALUE spg_date(const char *s, VALUE self, size_t length) {
542
544
  year++;
543
545
  }
544
546
 
545
- return rb_funcall(spg_Date, spg_id_new, 3, INT2NUM(year), INT2NUM(month), INT2NUM(day));
547
+ return rb_funcall(spg_Date, spg_id_new, 4, INT2NUM(year), INT2NUM(month), INT2NUM(day), SPG_DATE_GREGORIAN);
546
548
  }
547
549
 
548
550
  static VALUE spg_timestamp(const char *s, VALUE self, size_t length, int tz) {
@@ -724,7 +726,7 @@ static VALUE spg_timestamp(const char *s, VALUE self, size_t length, int tz) {
724
726
  * While PostgreSQL generally returns timestamps in local time, it's unwise to rely on this.
725
727
  */
726
728
  offset_fraction = offset_seconds/(double)SPG_SECONDS_PER_DAY;
727
- dt = rb_funcall(spg_DateTime, spg_id_new, 7, INT2NUM(year), INT2NUM(month), INT2NUM(day), INT2NUM(hour), INT2NUM(min), INT2NUM(sec), rb_float_new(offset_fraction));
729
+ dt = rb_funcall(spg_DateTime, spg_id_new, 8, INT2NUM(year), INT2NUM(month), INT2NUM(day), INT2NUM(hour), INT2NUM(min), INT2NUM(sec), rb_float_new(offset_fraction), SPG_DATE_GREGORIAN);
728
730
  SPG_DT_ADD_USEC
729
731
 
730
732
  if (tz & SPG_APP_LOCAL) {
@@ -735,7 +737,7 @@ static VALUE spg_timestamp(const char *s, VALUE self, size_t length, int tz) {
735
737
  }
736
738
  return dt;
737
739
  } else if (!(tz & (SPG_APP_LOCAL|SPG_DB_LOCAL|SPG_APP_UTC|SPG_DB_UTC))) {
738
- dt = rb_funcall(spg_DateTime, spg_id_new, 6, INT2NUM(year), INT2NUM(month), INT2NUM(day), INT2NUM(hour), INT2NUM(min), INT2NUM(sec));
740
+ dt = rb_funcall(spg_DateTime, spg_id_new, 8, INT2NUM(year), INT2NUM(month), INT2NUM(day), INT2NUM(hour), INT2NUM(min), INT2NUM(sec), rb_float_new(0.0), SPG_DATE_GREGORIAN);
739
741
  SPG_DT_ADD_USEC
740
742
  return dt;
741
743
  }
@@ -743,7 +745,7 @@ static VALUE spg_timestamp(const char *s, VALUE self, size_t length, int tz) {
743
745
  /* No offset given, and some timezone combination given */
744
746
  if (tz & SPG_DB_LOCAL) {
745
747
  offset_fraction = NUM2INT(rb_funcall(rb_funcall(rb_cTime, spg_id_local, 6, INT2NUM(year), INT2NUM(month), INT2NUM(day), INT2NUM(hour), INT2NUM(min), INT2NUM(sec)), spg_id_utc_offset, 0))/SPG_SECONDS_PER_DAY;
746
- dt = rb_funcall(spg_DateTime, spg_id_new, 7, INT2NUM(year), INT2NUM(month), INT2NUM(day), INT2NUM(hour), INT2NUM(min), INT2NUM(sec), rb_float_new(offset_fraction));
748
+ dt = rb_funcall(spg_DateTime, spg_id_new, 8, INT2NUM(year), INT2NUM(month), INT2NUM(day), INT2NUM(hour), INT2NUM(min), INT2NUM(sec), rb_float_new(offset_fraction), SPG_DATE_GREGORIAN);
747
749
  SPG_DT_ADD_USEC
748
750
  if (tz & SPG_APP_UTC) {
749
751
  return rb_funcall(dt, spg_id_new_offset, 1, INT2NUM(0));
@@ -751,7 +753,7 @@ static VALUE spg_timestamp(const char *s, VALUE self, size_t length, int tz) {
751
753
  return dt;
752
754
  }
753
755
  } else {
754
- dt = rb_funcall(spg_DateTime, spg_id_new, 6, INT2NUM(year), INT2NUM(month), INT2NUM(day), INT2NUM(hour), INT2NUM(min), INT2NUM(sec));
756
+ dt = rb_funcall(spg_DateTime, spg_id_new, 8, INT2NUM(year), INT2NUM(month), INT2NUM(day), INT2NUM(hour), INT2NUM(min), INT2NUM(sec), rb_float_new(0.0), SPG_DATE_GREGORIAN);
755
757
  SPG_DT_ADD_USEC
756
758
  if (tz & SPG_APP_LOCAL) {
757
759
  offset_fraction = NUM2INT(rb_funcall(rb_funcall(rb_cTime, spg_id_local, 6, INT2NUM(year), INT2NUM(month), INT2NUM(day), INT2NUM(hour), INT2NUM(min), INT2NUM(sec)), spg_id_utc_offset, 0))/SPG_SECONDS_PER_DAY;
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequel_pg
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.20.0
4
+ version: 1.21.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Evans
@@ -100,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
100
  - !ruby/object:Gem::Version
101
101
  version: '0'
102
102
  requirements: []
103
- rubygems_version: 4.0.16
103
+ rubygems_version: 4.0.20
104
104
  specification_version: 4
105
105
  summary: Faster SELECTs when using Sequel with pg
106
106
  test_files: []