Brain Docs

Reference

Rust SDKInstallationHTTP clientWire client
get_schemavalidate_schemaupload_schemareplace_schemadrop_schemalist_schemaslist_extractors
ErrorsRetriesPagination
Brain/Docs
✦ ASKBrain on GitHubDashboard
Rust SDKSchemareplace_schema

replace_schema

Replace the schema wholesale — and read the count of live rows it destroyed.

PURPOSE

Replace the schema wholesale rather than publishing a compatible new version. Rows that no longer fit are dropped — and you have to say so explicitly.

PUT/v1/schemaBearer API keystable
async fn replace_schema(&self, input: &SchemaReplaceInput) -> Result<SchemaReplaceResult, BrainHttpError>
Handshake credentialstable
async fn replace_schema(&self, request: &SchemaReplaceRequest) -> Result<SchemaReplaceResponse>

Parameters

ParameterTypeRequired
schema_documentstringrequired

The replacement.

force_drop_existingbooleanrequired

Required, not optional — you must state whether rows that no longer fit may be dropped. false makes the call fail rather than destroy data.

Returns

FieldTypePresence
namespace / schema_version—always

Where it landed.

dropped_countintegeralways

The number of live rows this replacement destroyed. Read it.

validation_errorsSchemaError[]always

Empty on success.

Validation failures are not exceptions

This verb resolves with a populated validationErrors array rather than throwing. Code that only wraps the call in a try/catch treats an invalid schema as a successful one. Check the array.

See also
upload_schemadrop_schema

Was this page helpful?

upload_schema

Publish a new schema version, with a dry run and an explicit opt-in for breaking changes.

drop_schema

Remove one declaration — and find out how many live rows still depend on it.

On this page

ParametersReturns
Suggest an editOpen in Playground