turbopuffer 2.5.0 → 2.6.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: c7a74005340bd71314cefec78857e87f61242c5e99ca0619718932862dfb9b3e
4
- data.tar.gz: 90568747fb99e6f0c3e07e135600cd49e48e806023059f27f0f270bb3f20ca20
3
+ metadata.gz: '058e339a61ee55eb37ca7fb90c0577139648fcfef118ce8f335d82251e0a3181'
4
+ data.tar.gz: 23fbb9c57f365f44173845c51a5363af452c6d644c16a529cb8c70e30cef8906
5
5
  SHA512:
6
- metadata.gz: e01efec060630c4a1b3840c93dc93148fd8724ffe326b7b697679a6d2a51eeecea9692ece6be917b3d42d7ed85ed1a958db57134f215b4290ab63f0c33521232
7
- data.tar.gz: 9ce535511cfc814424db7cf0c6567b35724ddb1c75550224866a805040220b2daf28c9b0dfa686153f2a6e8a41c056066c29d0952a805594e7bda8cfe356351b
6
+ metadata.gz: 03a5b108cafeb02ff74979349a226dcfc67d47c12a6f17e1955f81c1631c180a542808ef36818c6b251ec48bfdf80a57314bfb33949f176916e0802f50cdab8f
7
+ data.tar.gz: e2eb636c572b8637f0d87812adfab0b30b2b0cfb2042841136529dde7a776c59e827595e7fe48751caeb92746f34bc3534a7bfe219b70380fa1e6c8b2956fc74
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.6.0](https://github.com/turbopuffer/turbopuffer-ruby/compare/v2.5.0...v2.6.0) (2026-10-07)
4
+
5
+
6
+ ### Features
7
+
8
+ * add create_namespace to openapi.yml ([39cb498](https://github.com/turbopuffer/turbopuffer-ruby/commit/39cb4987eb4b8783caf2484554588e954be76244))
9
+ * stainless to stlc migration ([6e6718f](https://github.com/turbopuffer/turbopuffer-ruby/commit/6e6718fd42b5c2608ea0164f5cf32ea6609104ad))
10
+ * stlc: qol fixes ([95ae3c3](https://github.com/turbopuffer/turbopuffer-ruby/commit/95ae3c31b03afe8384da1f384a6eb0cdcda952f3))
11
+
3
12
  ## 2.5.0 (2026-09-18)
4
13
 
5
14
  Full Changelog: [v2.4.0...v2.5.0](https://github.com/turbopuffer/turbopuffer-ruby/compare/v2.4.0...v2.5.0)
data/README.md CHANGED
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
17
17
  <!-- x-release-please-start-version -->
18
18
 
19
19
  ```ruby
20
- gem "turbopuffer", "~> 2.5.0"
20
+ gem "turbopuffer", "~> 2.6.0"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -12,8 +12,11 @@ module Turbopuffer
12
12
  # Detailed configuration for an attribute attached to a document.
13
13
  variant -> { Turbopuffer::AttributeSchemaConfig }
14
14
 
15
+ # Drops the attribute from the namespace. Cannot be combined with other schema settings.
16
+ variant -> { Turbopuffer::AttributeSchemaDrop }
17
+
15
18
  # @!method self.variants
16
- # @return [Array(String, Turbopuffer::Models::AttributeSchemaConfig)]
19
+ # @return [Array(String, Turbopuffer::Models::AttributeSchemaConfig, Turbopuffer::Models::AttributeSchemaDrop)]
17
20
  end
18
21
  end
19
22
  end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Turbopuffer
4
+ module Models
5
+ class AttributeSchemaDrop < Turbopuffer::Internal::Type::BaseModel
6
+ # @!attribute drop
7
+ # Must be `true`.
8
+ #
9
+ # @return [Boolean]
10
+ required :drop, Turbopuffer::Internal::Type::Boolean
11
+
12
+ # @!method initialize(drop:)
13
+ # Drops the attribute from the namespace. Cannot be combined with other schema
14
+ # settings.
15
+ #
16
+ # @param drop [Boolean] Must be `true`.
17
+ end
18
+ end
19
+ end
@@ -15,13 +15,13 @@ module Turbopuffer
15
15
  # @!attribute schema
16
16
  # The desired schema for the namespace.
17
17
  #
18
- # @return [Hash{Symbol=>String, Turbopuffer::Models::AttributeSchemaConfig}, nil]
18
+ # @return [Hash{Symbol=>String, Turbopuffer::Models::AttributeSchemaConfig, Turbopuffer::Models::AttributeSchemaDrop}, nil]
19
19
  optional :schema, -> { Turbopuffer::Internal::Type::HashOf[union: Turbopuffer::AttributeSchema] }
20
20
 
21
21
  # @!method initialize(namespace: nil, schema: nil, request_options: {})
22
22
  # @param namespace [String]
23
23
  #
24
- # @param schema [Hash{Symbol=>String, Turbopuffer::Models::AttributeSchemaConfig}] The desired schema for the namespace.
24
+ # @param schema [Hash{Symbol=>String, Turbopuffer::Models::AttributeSchemaConfig, Turbopuffer::Models::AttributeSchemaDrop}] The desired schema for the namespace.
25
25
  #
26
26
  # @param request_options [Turbopuffer::RequestOptions, Hash{Symbol=>Object}]
27
27
  end
@@ -24,6 +24,16 @@ module Turbopuffer
24
24
  # @return [String, Turbopuffer::Models::CopyFromNamespaceParams::CopyFromNamespaceConfig, nil]
25
25
  optional :copy_from_namespace, union: -> { Turbopuffer::CopyFromNamespaceParams }
26
26
 
27
+ # @!attribute create_namespace
28
+ # If `true`, ensures the namespace is created, even if the request writes no
29
+ # documents. Creating an empty namespace requires the `id` type to be declared in
30
+ # `schema`. If `false`, a namespace is never created, and a 404 is returned if it
31
+ # does not exist. If omitted, a namespace is created by the first request that
32
+ # writes documents.
33
+ #
34
+ # @return [Boolean, nil]
35
+ optional :create_namespace, Turbopuffer::Internal::Type::Boolean
36
+
27
37
  # @!attribute delete_by_filter
28
38
  # The filter specifying which documents to delete.
29
39
  #
@@ -108,7 +118,7 @@ module Turbopuffer
108
118
  # @!attribute schema
109
119
  # The schema of the attributes attached to the documents.
110
120
  #
111
- # @return [Hash{Symbol=>String, Turbopuffer::Models::AttributeSchemaConfig}, nil]
121
+ # @return [Hash{Symbol=>String, Turbopuffer::Models::AttributeSchemaConfig, Turbopuffer::Models::AttributeSchemaDrop}, nil]
112
122
  optional :schema, -> { Turbopuffer::Internal::Type::HashOf[union: Turbopuffer::AttributeSchema] }
113
123
 
114
124
  # @!attribute sharding
@@ -139,7 +149,7 @@ module Turbopuffer
139
149
  # @return [Array<Turbopuffer::Models::Row>, nil]
140
150
  optional :upsert_rows, -> { Turbopuffer::Internal::Type::ArrayOf[Turbopuffer::Row] }
141
151
 
142
- # @!method initialize(namespace: nil, branch_from_namespace: nil, copy_from_namespace: nil, delete_by_filter: nil, delete_by_filter_allow_partial: nil, delete_condition: nil, deletes: nil, disable_backpressure: nil, distance_metric: nil, encryption: nil, patch_by_filter: nil, patch_by_filter_allow_partial: nil, patch_columns: nil, patch_condition: nil, patch_rows: nil, return_affected_ids: nil, schema: nil, sharding: nil, upsert_columns: nil, upsert_condition: nil, upsert_rows: nil, request_options: {})
152
+ # @!method initialize(namespace: nil, branch_from_namespace: nil, copy_from_namespace: nil, create_namespace: nil, delete_by_filter: nil, delete_by_filter_allow_partial: nil, delete_condition: nil, deletes: nil, disable_backpressure: nil, distance_metric: nil, encryption: nil, patch_by_filter: nil, patch_by_filter_allow_partial: nil, patch_columns: nil, patch_condition: nil, patch_rows: nil, return_affected_ids: nil, schema: nil, sharding: nil, upsert_columns: nil, upsert_condition: nil, upsert_rows: nil, request_options: {})
143
153
  # Some parameter documentations has been truncated, see
144
154
  # {Turbopuffer::Models::NamespaceWriteParams} for more details.
145
155
  #
@@ -149,6 +159,8 @@ module Turbopuffer
149
159
  #
150
160
  # @param copy_from_namespace [String, Turbopuffer::Models::CopyFromNamespaceParams::CopyFromNamespaceConfig] The namespace to copy documents from.
151
161
  #
162
+ # @param create_namespace [Boolean] If `true`, ensures the namespace is created, even if the request writes no docum
163
+ #
152
164
  # @param delete_by_filter [Object] The filter specifying which documents to delete.
153
165
  #
154
166
  # @param delete_by_filter_allow_partial [Boolean] Allow partial completion when filter matches too many documents.
@@ -175,7 +187,7 @@ module Turbopuffer
175
187
  #
176
188
  # @param return_affected_ids [Boolean] If true, return the IDs of affected rows (deleted, patched, upserted) in the res
177
189
  #
178
- # @param schema [Hash{Symbol=>String, Turbopuffer::Models::AttributeSchemaConfig}] The schema of the attributes attached to the documents.
190
+ # @param schema [Hash{Symbol=>String, Turbopuffer::Models::AttributeSchemaConfig, Turbopuffer::Models::AttributeSchemaDrop}] The schema of the attributes attached to the documents.
179
191
  #
180
192
  # @param sharding [Turbopuffer::Models::ShardingConfig] Configuration for namespace sharding, which partitions a namespace's documents a
181
193
  #
@@ -50,6 +50,8 @@ module Turbopuffer
50
50
 
51
51
  AttributeSchemaConfig = Turbopuffer::Models::AttributeSchemaConfig
52
52
 
53
+ AttributeSchemaDrop = Turbopuffer::Models::AttributeSchemaDrop
54
+
53
55
  AttributeType = Turbopuffer::Models::AttributeType
54
56
 
55
57
  Bm25ClauseParams = Turbopuffer::Models::Bm25ClauseParams
@@ -463,7 +463,7 @@ module Turbopuffer
463
463
  #
464
464
  # @param namespace [String] Path param: The name of the namespace.
465
465
  #
466
- # @param schema [Hash{Symbol=>String, Turbopuffer::Models::AttributeSchemaConfig}] Body param: The desired schema for the namespace.
466
+ # @param schema [Hash{Symbol=>String, Turbopuffer::Models::AttributeSchemaConfig, Turbopuffer::Models::AttributeSchemaDrop}] Body param: The desired schema for the namespace.
467
467
  #
468
468
  # @param request_options [Turbopuffer::RequestOptions, Hash{Symbol=>Object}, nil]
469
469
  #
@@ -490,7 +490,7 @@ module Turbopuffer
490
490
  #
491
491
  # Create, update, or delete documents.
492
492
  #
493
- # @overload write(namespace: nil, branch_from_namespace: nil, copy_from_namespace: nil, delete_by_filter: nil, delete_by_filter_allow_partial: nil, delete_condition: nil, deletes: nil, disable_backpressure: nil, distance_metric: nil, encryption: nil, patch_by_filter: nil, patch_by_filter_allow_partial: nil, patch_columns: nil, patch_condition: nil, patch_rows: nil, return_affected_ids: nil, schema: nil, sharding: nil, upsert_columns: nil, upsert_condition: nil, upsert_rows: nil, request_options: {})
493
+ # @overload write(namespace: nil, branch_from_namespace: nil, copy_from_namespace: nil, create_namespace: nil, delete_by_filter: nil, delete_by_filter_allow_partial: nil, delete_condition: nil, deletes: nil, disable_backpressure: nil, distance_metric: nil, encryption: nil, patch_by_filter: nil, patch_by_filter_allow_partial: nil, patch_columns: nil, patch_condition: nil, patch_rows: nil, return_affected_ids: nil, schema: nil, sharding: nil, upsert_columns: nil, upsert_condition: nil, upsert_rows: nil, request_options: {})
494
494
  #
495
495
  # @param namespace [String] Path param: The name of the namespace.
496
496
  #
@@ -498,6 +498,8 @@ module Turbopuffer
498
498
  #
499
499
  # @param copy_from_namespace [String, Turbopuffer::Models::CopyFromNamespaceParams::CopyFromNamespaceConfig] Body param: The namespace to copy documents from.
500
500
  #
501
+ # @param create_namespace [Boolean] Body param: If `true`, ensures the namespace is created, even if the request wri
502
+ #
501
503
  # @param delete_by_filter [Object] Body param: The filter specifying which documents to delete.
502
504
  #
503
505
  # @param delete_by_filter_allow_partial [Boolean] Body param: Allow partial completion when filter matches too many documents.
@@ -524,7 +526,7 @@ module Turbopuffer
524
526
  #
525
527
  # @param return_affected_ids [Boolean] Body param: If true, return the IDs of affected rows (deleted, patched, upserted
526
528
  #
527
- # @param schema [Hash{Symbol=>String, Turbopuffer::Models::AttributeSchemaConfig}] Body param: The schema of the attributes attached to the documents.
529
+ # @param schema [Hash{Symbol=>String, Turbopuffer::Models::AttributeSchemaConfig, Turbopuffer::Models::AttributeSchemaDrop}] Body param: The schema of the attributes attached to the documents.
528
530
  #
529
531
  # @param sharding [Turbopuffer::Models::ShardingConfig] Body param: Configuration for namespace sharding, which partitions a namespace's
530
532
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Turbopuffer
4
- VERSION = "2.5.0"
4
+ VERSION = "2.6.0"
5
5
  end
data/lib/turbopuffer.rb CHANGED
@@ -61,6 +61,7 @@ require_relative "turbopuffer/models/attribute_embed"
61
61
  require_relative "turbopuffer/models/attribute_embed_config"
62
62
  require_relative "turbopuffer/models/attribute_schema"
63
63
  require_relative "turbopuffer/models/attribute_schema_config"
64
+ require_relative "turbopuffer/models/attribute_schema_drop"
64
65
  require_relative "turbopuffer/models/attribute_type"
65
66
  require_relative "turbopuffer/models/bm25_clause_params"
66
67
  require_relative "turbopuffer/models/branch_from_namespace_params"
@@ -7,7 +7,13 @@ module Turbopuffer
7
7
  extend Turbopuffer::Internal::Type::Union
8
8
 
9
9
  Variants =
10
- T.type_alias { T.any(String, Turbopuffer::AttributeSchemaConfig) }
10
+ T.type_alias do
11
+ T.any(
12
+ String,
13
+ Turbopuffer::AttributeSchemaConfig,
14
+ Turbopuffer::AttributeSchemaDrop
15
+ )
16
+ end
11
17
 
12
18
  sig { override.returns(T::Array[Turbopuffer::AttributeSchema::Variants]) }
13
19
  def self.variants
@@ -0,0 +1,32 @@
1
+ # typed: strong
2
+
3
+ module Turbopuffer
4
+ module Models
5
+ class AttributeSchemaDrop < Turbopuffer::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ Turbopuffer::AttributeSchemaDrop,
10
+ Turbopuffer::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # Must be `true`.
15
+ sig { returns(T::Boolean) }
16
+ attr_accessor :drop
17
+
18
+ # Drops the attribute from the namespace. Cannot be combined with other schema
19
+ # settings.
20
+ sig { params(drop: T::Boolean).returns(T.attached_class) }
21
+ def self.new(
22
+ # Must be `true`.
23
+ drop:
24
+ )
25
+ end
26
+
27
+ sig { override.returns({ drop: T::Boolean }) }
28
+ def to_hash
29
+ end
30
+ end
31
+ end
32
+ end
@@ -24,7 +24,14 @@ module Turbopuffer
24
24
  sig do
25
25
  returns(
26
26
  T.nilable(
27
- T::Hash[Symbol, T.any(String, Turbopuffer::AttributeSchemaConfig)]
27
+ T::Hash[
28
+ Symbol,
29
+ T.any(
30
+ String,
31
+ Turbopuffer::AttributeSchemaConfig,
32
+ Turbopuffer::AttributeSchemaDrop
33
+ )
34
+ ]
28
35
  )
29
36
  )
30
37
  end
@@ -35,7 +42,11 @@ module Turbopuffer
35
42
  schema:
36
43
  T::Hash[
37
44
  Symbol,
38
- T.any(String, Turbopuffer::AttributeSchemaConfig::OrHash)
45
+ T.any(
46
+ String,
47
+ Turbopuffer::AttributeSchemaConfig::OrHash,
48
+ Turbopuffer::AttributeSchemaDrop::OrHash
49
+ )
39
50
  ]
40
51
  ).void
41
52
  end
@@ -47,7 +58,11 @@ module Turbopuffer
47
58
  schema:
48
59
  T::Hash[
49
60
  Symbol,
50
- T.any(String, Turbopuffer::AttributeSchemaConfig::OrHash)
61
+ T.any(
62
+ String,
63
+ Turbopuffer::AttributeSchemaConfig::OrHash,
64
+ Turbopuffer::AttributeSchemaDrop::OrHash
65
+ )
51
66
  ],
52
67
  request_options: Turbopuffer::RequestOptions::OrHash
53
68
  ).returns(T.attached_class)
@@ -67,7 +82,11 @@ module Turbopuffer
67
82
  schema:
68
83
  T::Hash[
69
84
  Symbol,
70
- T.any(String, Turbopuffer::AttributeSchemaConfig)
85
+ T.any(
86
+ String,
87
+ Turbopuffer::AttributeSchemaConfig,
88
+ Turbopuffer::AttributeSchemaDrop
89
+ )
71
90
  ],
72
91
  request_options: Turbopuffer::RequestOptions
73
92
  }
@@ -68,6 +68,17 @@ module Turbopuffer
68
68
  end
69
69
  attr_writer :copy_from_namespace
70
70
 
71
+ # If `true`, ensures the namespace is created, even if the request writes no
72
+ # documents. Creating an empty namespace requires the `id` type to be declared in
73
+ # `schema`. If `false`, a namespace is never created, and a 404 is returned if it
74
+ # does not exist. If omitted, a namespace is created by the first request that
75
+ # writes documents.
76
+ sig { returns(T.nilable(T::Boolean)) }
77
+ attr_reader :create_namespace
78
+
79
+ sig { params(create_namespace: T::Boolean).void }
80
+ attr_writer :create_namespace
81
+
71
82
  # The filter specifying which documents to delete.
72
83
  sig { returns(T.nilable(T.anything)) }
73
84
  attr_reader :delete_by_filter
@@ -192,7 +203,14 @@ module Turbopuffer
192
203
  sig do
193
204
  returns(
194
205
  T.nilable(
195
- T::Hash[Symbol, T.any(String, Turbopuffer::AttributeSchemaConfig)]
206
+ T::Hash[
207
+ Symbol,
208
+ T.any(
209
+ String,
210
+ Turbopuffer::AttributeSchemaConfig,
211
+ Turbopuffer::AttributeSchemaDrop
212
+ )
213
+ ]
196
214
  )
197
215
  )
198
216
  end
@@ -203,7 +221,11 @@ module Turbopuffer
203
221
  schema:
204
222
  T::Hash[
205
223
  Symbol,
206
- T.any(String, Turbopuffer::AttributeSchemaConfig::OrHash)
224
+ T.any(
225
+ String,
226
+ Turbopuffer::AttributeSchemaConfig::OrHash,
227
+ Turbopuffer::AttributeSchemaDrop::OrHash
228
+ )
207
229
  ]
208
230
  ).void
209
231
  end
@@ -254,6 +276,7 @@ module Turbopuffer
254
276
  String,
255
277
  Turbopuffer::CopyFromNamespaceParams::CopyFromNamespaceConfig::OrHash
256
278
  ),
279
+ create_namespace: T::Boolean,
257
280
  delete_by_filter: T.anything,
258
281
  delete_by_filter_allow_partial: T::Boolean,
259
282
  delete_condition: T.anything,
@@ -275,7 +298,11 @@ module Turbopuffer
275
298
  schema:
276
299
  T::Hash[
277
300
  Symbol,
278
- T.any(String, Turbopuffer::AttributeSchemaConfig::OrHash)
301
+ T.any(
302
+ String,
303
+ Turbopuffer::AttributeSchemaConfig::OrHash,
304
+ Turbopuffer::AttributeSchemaDrop::OrHash
305
+ )
279
306
  ],
280
307
  sharding: Turbopuffer::ShardingConfig::OrHash,
281
308
  upsert_columns: Turbopuffer::Columns::OrHash,
@@ -290,6 +317,12 @@ module Turbopuffer
290
317
  branch_from_namespace: nil,
291
318
  # The namespace to copy documents from.
292
319
  copy_from_namespace: nil,
320
+ # If `true`, ensures the namespace is created, even if the request writes no
321
+ # documents. Creating an empty namespace requires the `id` type to be declared in
322
+ # `schema`. If `false`, a namespace is never created, and a 404 is returned if it
323
+ # does not exist. If omitted, a namespace is created by the first request that
324
+ # writes documents.
325
+ create_namespace: nil,
293
326
  # The filter specifying which documents to delete.
294
327
  delete_by_filter: nil,
295
328
  # Allow partial completion when filter matches too many documents.
@@ -351,6 +384,7 @@ module Turbopuffer
351
384
  String,
352
385
  Turbopuffer::CopyFromNamespaceParams::CopyFromNamespaceConfig
353
386
  ),
387
+ create_namespace: T::Boolean,
354
388
  delete_by_filter: T.anything,
355
389
  delete_by_filter_allow_partial: T::Boolean,
356
390
  delete_condition: T.anything,
@@ -371,7 +405,11 @@ module Turbopuffer
371
405
  schema:
372
406
  T::Hash[
373
407
  Symbol,
374
- T.any(String, Turbopuffer::AttributeSchemaConfig)
408
+ T.any(
409
+ String,
410
+ Turbopuffer::AttributeSchemaConfig,
411
+ Turbopuffer::AttributeSchemaDrop
412
+ )
375
413
  ],
376
414
  sharding: Turbopuffer::ShardingConfig,
377
415
  upsert_columns: Turbopuffer::Columns,
@@ -15,6 +15,8 @@ module Turbopuffer
15
15
 
16
16
  AttributeSchemaConfig = Turbopuffer::Models::AttributeSchemaConfig
17
17
 
18
+ AttributeSchemaDrop = Turbopuffer::Models::AttributeSchemaDrop
19
+
18
20
  AttributeType = Turbopuffer::Models::AttributeType
19
21
 
20
22
  Bm25ClauseParams = Turbopuffer::Models::Bm25ClauseParams
@@ -382,7 +382,11 @@ module Turbopuffer
382
382
  schema:
383
383
  T::Hash[
384
384
  Symbol,
385
- T.any(String, Turbopuffer::AttributeSchemaConfig::OrHash)
385
+ T.any(
386
+ String,
387
+ Turbopuffer::AttributeSchemaConfig::OrHash,
388
+ Turbopuffer::AttributeSchemaDrop::OrHash
389
+ )
386
390
  ],
387
391
  request_options: Turbopuffer::RequestOptions::OrHash
388
392
  ).returns(T::Hash[Symbol, Turbopuffer::AttributeSchemaConfig])
@@ -410,6 +414,7 @@ module Turbopuffer
410
414
  String,
411
415
  Turbopuffer::CopyFromNamespaceParams::CopyFromNamespaceConfig::OrHash
412
416
  ),
417
+ create_namespace: T::Boolean,
413
418
  delete_by_filter: T.anything,
414
419
  delete_by_filter_allow_partial: T::Boolean,
415
420
  delete_condition: T.anything,
@@ -431,7 +436,11 @@ module Turbopuffer
431
436
  schema:
432
437
  T::Hash[
433
438
  Symbol,
434
- T.any(String, Turbopuffer::AttributeSchemaConfig::OrHash)
439
+ T.any(
440
+ String,
441
+ Turbopuffer::AttributeSchemaConfig::OrHash,
442
+ Turbopuffer::AttributeSchemaDrop::OrHash
443
+ )
435
444
  ],
436
445
  sharding: Turbopuffer::ShardingConfig::OrHash,
437
446
  upsert_columns: Turbopuffer::Columns::OrHash,
@@ -447,6 +456,12 @@ module Turbopuffer
447
456
  branch_from_namespace: nil,
448
457
  # Body param: The namespace to copy documents from.
449
458
  copy_from_namespace: nil,
459
+ # Body param: If `true`, ensures the namespace is created, even if the request
460
+ # writes no documents. Creating an empty namespace requires the `id` type to be
461
+ # declared in `schema`. If `false`, a namespace is never created, and a 404 is
462
+ # returned if it does not exist. If omitted, a namespace is created by the first
463
+ # request that writes documents.
464
+ create_namespace: nil,
450
465
  # Body param: The filter specifying which documents to delete.
451
466
  delete_by_filter: nil,
452
467
  # Body param: Allow partial completion when filter matches too many documents.
@@ -1,6 +1,9 @@
1
1
  module Turbopuffer
2
2
  module Models
3
- type attribute_schema = String | Turbopuffer::AttributeSchemaConfig
3
+ type attribute_schema =
4
+ String
5
+ | Turbopuffer::AttributeSchemaConfig
6
+ | Turbopuffer::AttributeSchemaDrop
4
7
 
5
8
  module AttributeSchema
6
9
  extend Turbopuffer::Internal::Type::Union
@@ -0,0 +1,13 @@
1
+ module Turbopuffer
2
+ module Models
3
+ type attribute_schema_drop = { drop: bool }
4
+
5
+ class AttributeSchemaDrop < Turbopuffer::Internal::Type::BaseModel
6
+ attr_accessor drop: bool
7
+
8
+ def initialize: (drop: bool) -> void
9
+
10
+ def to_hash: -> { drop: bool }
11
+ end
12
+ end
13
+ end
@@ -5,6 +5,7 @@ module Turbopuffer
5
5
  namespace: String,
6
6
  branch_from_namespace: Turbopuffer::Models::branch_from_namespace_params,
7
7
  copy_from_namespace: Turbopuffer::Models::copy_from_namespace_params,
8
+ create_namespace: bool,
8
9
  delete_by_filter: top,
9
10
  delete_by_filter_allow_partial: bool,
10
11
  delete_condition: top,
@@ -46,6 +47,10 @@ module Turbopuffer
46
47
  Turbopuffer::Models::copy_from_namespace_params
47
48
  ) -> Turbopuffer::Models::copy_from_namespace_params
48
49
 
50
+ attr_reader create_namespace: bool?
51
+
52
+ def create_namespace=: (bool) -> bool
53
+
49
54
  attr_reader delete_by_filter: top?
50
55
 
51
56
  def delete_by_filter=: (top) -> top
@@ -134,6 +139,7 @@ module Turbopuffer
134
139
  ?namespace: String,
135
140
  ?branch_from_namespace: Turbopuffer::Models::branch_from_namespace_params,
136
141
  ?copy_from_namespace: Turbopuffer::Models::copy_from_namespace_params,
142
+ ?create_namespace: bool,
137
143
  ?delete_by_filter: top,
138
144
  ?delete_by_filter_allow_partial: bool,
139
145
  ?delete_condition: top,
@@ -159,6 +165,7 @@ module Turbopuffer
159
165
  namespace: String,
160
166
  branch_from_namespace: Turbopuffer::Models::branch_from_namespace_params,
161
167
  copy_from_namespace: Turbopuffer::Models::copy_from_namespace_params,
168
+ create_namespace: bool,
162
169
  delete_by_filter: top,
163
170
  delete_by_filter_allow_partial: bool,
164
171
  delete_condition: top,
@@ -9,6 +9,8 @@ module Turbopuffer
9
9
 
10
10
  class AttributeSchemaConfig = Turbopuffer::Models::AttributeSchemaConfig
11
11
 
12
+ class AttributeSchemaDrop = Turbopuffer::Models::AttributeSchemaDrop
13
+
12
14
  class AttributeType = Turbopuffer::Models::AttributeType
13
15
 
14
16
  class Bm25ClauseParams = Turbopuffer::Models::Bm25ClauseParams
@@ -125,6 +125,7 @@ module Turbopuffer
125
125
  ?namespace: String,
126
126
  ?branch_from_namespace: Turbopuffer::Models::branch_from_namespace_params,
127
127
  ?copy_from_namespace: Turbopuffer::Models::copy_from_namespace_params,
128
+ ?create_namespace: bool,
128
129
  ?delete_by_filter: top,
129
130
  ?delete_by_filter_allow_partial: bool,
130
131
  ?delete_condition: top,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turbopuffer
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 2.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Turbopuffer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-09-18 00:00:00.000000000 Z
11
+ date: 2026-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cgi
@@ -76,6 +76,7 @@ files:
76
76
  - lib/turbopuffer/models/attribute_embed_config.rb
77
77
  - lib/turbopuffer/models/attribute_schema.rb
78
78
  - lib/turbopuffer/models/attribute_schema_config.rb
79
+ - lib/turbopuffer/models/attribute_schema_drop.rb
79
80
  - lib/turbopuffer/models/attribute_type.rb
80
81
  - lib/turbopuffer/models/bm25_clause_params.rb
81
82
  - lib/turbopuffer/models/branch_from_namespace_params.rb
@@ -177,6 +178,7 @@ files:
177
178
  - rbi/turbopuffer/models/attribute_embed_config.rbi
178
179
  - rbi/turbopuffer/models/attribute_schema.rbi
179
180
  - rbi/turbopuffer/models/attribute_schema_config.rbi
181
+ - rbi/turbopuffer/models/attribute_schema_drop.rbi
180
182
  - rbi/turbopuffer/models/attribute_type.rbi
181
183
  - rbi/turbopuffer/models/bm25_clause_params.rbi
182
184
  - rbi/turbopuffer/models/branch_from_namespace_params.rbi
@@ -277,6 +279,7 @@ files:
277
279
  - sig/turbopuffer/models/attribute_embed_config.rbs
278
280
  - sig/turbopuffer/models/attribute_schema.rbs
279
281
  - sig/turbopuffer/models/attribute_schema_config.rbs
282
+ - sig/turbopuffer/models/attribute_schema_drop.rbs
280
283
  - sig/turbopuffer/models/attribute_type.rbs
281
284
  - sig/turbopuffer/models/bm25_clause_params.rbs
282
285
  - sig/turbopuffer/models/branch_from_namespace_params.rbs