data_drain 0.1.7 → 0.1.9

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: a5a4767539f7a1e03be113cbdb218eba708228e2d4255734bd6150a913e414a0
4
- data.tar.gz: d7a5d26b5ce4cb545a5e2132e09d72b65569aad6c2716b681f9c07dcfea80747
3
+ metadata.gz: '08913cb191ba486527ec51ccd55531693dad08f5f1d8e1d655252beb1122a9d5'
4
+ data.tar.gz: 167c9a4b5895df254a198e6c4e09ad27d68f199dc8032f118dcd08341b10999a
5
5
  SHA512:
6
- metadata.gz: 5b2c335c98d509d951d6fdea54ad3068c2fd539a88033ef0d4be8e6c12127d019b24086b02eb60c31e63d65ba99bd51daa2d10e595b46c21a01ebdc1516082dc
7
- data.tar.gz: 95a6fe6c0b97862c624668a8123383f0206744bfecf09f04e57bc17cc95eba27ea86f0f5d083dd8e948f9490eb640189f8bfcc7b9a39a2c924a419cbe54edda4
6
+ metadata.gz: d7396d81fa1a61dee43533452ac17a695619dd77da8f26e4be3cb33f5eaa55c5f0f6697a339212def3e811730a22e80d71c4e8b5bb74b6890e3a71656f470815
7
+ data.tar.gz: 83a9f514895f61460d9e9f1eb284e9acd8d4b1610c495d7ce9d72f2123a08e2d5380a50b7d820a409e0d62674a9f8611c74df967aac4b11982ce03933adb995e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.1.9] - 2026-03-17
4
+
5
+ - Fix: Mejora en la precisión del rango de fechas en consultas SQL usando límites semi-abiertos (<) para evitar pérdida de registros por microsegundos.
6
+
7
+ ## [0.1.8] - 2026-03-16
8
+
9
+ - Fix: Se cambió la cadena de conexión de DuckDB a formato URI para propagar el timeout de sesión en el ATTACH.
10
+
3
11
  ## [0.1.7] - 2026-03-16
4
12
 
5
13
  - Se agrego soporte para idle_in_transaction_session_timeout.
@@ -25,7 +25,7 @@ module DataDrain
25
25
 
26
26
  # @return [String] Cadena de conexión optimizada para DuckDB.
27
27
  def duckdb_connection_string
28
- "host=#{@db_host} port=#{@db_port} dbname=#{@db_name} user=#{@db_user} password=#{@db_pass}"
28
+ "postgresql://#{@db_user}:#{@db_pass}@#{@db_host}:#{@db_port}/#{@db_name}?options=-c%20idle_in_transaction_session_timeout%3D#{@idle_in_transaction_session_timeout}"
29
29
  end
30
30
  end
31
31
  end
@@ -22,7 +22,11 @@ module DataDrain
22
22
  # @option options [String] :where_clause (Opcional) Condición SQL extra.
23
23
  def initialize(options)
24
24
  @start_date = options.fetch(:start_date).beginning_of_day
25
- @end_date = options.fetch(:end_date).end_of_day
25
+
26
+ # Usamos el inicio del día siguiente como límite superior estricto (<)
27
+ # Esto evita problemas de precisión con los microsegundos al usar end_of_day
28
+ @end_date = options.fetch(:end_date).to_date.next_day.beginning_of_day
29
+
26
30
  @table_name = options.fetch(:table_name)
27
31
  @folder_name = options.fetch(:folder_name, @table_name)
28
32
  @select_sql = options.fetch(:select_sql, "*")
@@ -72,7 +76,7 @@ module DataDrain
72
76
  # @api private
73
77
  # @return [String]
74
78
  def base_where_sql
75
- sql = "created_at >= '#{@start_date.to_fs(:db)}' AND created_at <= '#{@end_date.to_fs(:db)}'"
79
+ sql = "created_at >= '#{@start_date.to_fs(:db)}' AND created_at < '#{@end_date.to_fs(:db)}'"
76
80
  sql += " AND #{@where_clause}" if @where_clause && !@where_clause.empty?
77
81
  sql
78
82
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DataDrain
4
- VERSION = "0.1.7"
4
+ VERSION = "0.1.9"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: data_drain
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriel
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-03-16 00:00:00.000000000 Z
11
+ date: 2026-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel