activerecord-turbopuffer-adapter 0.1.9 → 0.1.10
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ae2b8fa993fe940121966a4d3c8c9b95a43afc484348f1598ed76bb24ad0c021
|
|
4
|
+
data.tar.gz: 02b90f77da9ec0f5133fc021fa516b64516a79eea2b6d63d0bacf6b7feb97399
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fe02be8410aae63cc2479a3cb9ec52e1b54ffae8f34e21b33a63168f3572edeef99d5ccce08a675ce30adc227f967e519f4dd66cedb160a4f1b0dc4299a79c1b
|
|
7
|
+
data.tar.gz: ba93057de23dd67659cdbfd4d0a8e822fddd7ff162129932b995061c8c8e8d19cb10ae832c08e41639b2edf619d5119239b7f01043d42404bd7aaaac1f0ce37e
|
data/README.md
CHANGED
|
@@ -284,7 +284,7 @@ module ActiveRecord
|
|
|
284
284
|
|
|
285
285
|
tpuf_query_args[:offset] = query.offset if query.offset
|
|
286
286
|
|
|
287
|
-
tpuf_query_args[:rank_by] = query.rank_by
|
|
287
|
+
tpuf_query_args[:rank_by] = query.rank_by if query.rank_by
|
|
288
288
|
tpuf_query_args[:filters] = query.filters if query.filters
|
|
289
289
|
consistency = consistency_for(query)
|
|
290
290
|
tpuf_query_args[:consistency] = consistency if consistency
|
|
@@ -101,11 +101,18 @@ module Arel::Visitors
|
|
|
101
101
|
end
|
|
102
102
|
end
|
|
103
103
|
|
|
104
|
-
def
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
def ranking(orders)
|
|
105
|
+
return if orders.empty?
|
|
106
|
+
return visit(orders.first) if orders.size == 1
|
|
107
|
+
|
|
108
|
+
if orders.any? { |order| order.is_a?(Arel::Nodes::RankByNode) }
|
|
109
|
+
raise NotImplementedError, "a ranking cannot be combined with other orderings, sort in Ruby after loading"
|
|
110
|
+
end
|
|
108
111
|
|
|
112
|
+
orders.map { |order| visit(order) }
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
def visit_Arel_Nodes_SelectStatement(o)
|
|
109
116
|
core = o.cores.last
|
|
110
117
|
|
|
111
118
|
raise NotImplementedError, "distinct is not implemented yet" if core.set_quantifier
|
|
@@ -125,7 +132,7 @@ module Arel::Visitors
|
|
|
125
132
|
namespace: visit(core.source),
|
|
126
133
|
filters: conjoin(filters),
|
|
127
134
|
top_k: o.limit && visit(o.limit),
|
|
128
|
-
rank_by: o.orders
|
|
135
|
+
rank_by: ranking(o.orders),
|
|
129
136
|
include_attributes: attributes.flat_map { |p| visit(p) },
|
|
130
137
|
group_by: core.groups.map { |g| visit(g) },
|
|
131
138
|
aggregate_by: aggregate && visit(aggregate),
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: activerecord-turbopuffer-adapter
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Richard Monette
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-10-
|
|
10
|
+
date: 2026-10-18 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: activerecord
|