> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# avro_schema_builder

> avro_schema_builder — Kinetica Rust API

[gpudb\_api](https://docs.kinetica.com/content/api/rust/index.md)
[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/avro_schema_builder.rs#L1-L1020)&#x20;

Avro Schema Builder for Kinetica RecordsThis module provides a builder-style API for constructing Avro schemas programmatically, eliminating the need to hand-write JSON schema strings.

## Example

```rust theme={null}
use gpudb_api::avro_schema_builder::{AvroSchemaBuilder, AvroType};

let schema = AvroSchemaBuilder::new("MyRecord")
    .field("id", AvroType::Int)
    .field("name", AvroType::String)
    .field("timestamp", AvroType::Long)
    .nullable_field("description", AvroType::String)
    .field("data", AvroType::Bytes)
    .build();

// schema is now a valid Avro JSON schema string
```

## Modules

[bool\_<wbr />as\_<wbr />int](https://docs.kinetica.com/content/api/rust/avro_schema_builder/bool_as_int/index.md)Writes a `bool` as the Avro int a Kinetica boolean column holds, 1 or 0, and reads any int other than 0 as `true`. For a field declared with [`AvroSchemaBuilder::bool_field`](https://docs.kinetica.com/content/api/rust/avro_schema_builder/struct.AvroSchemaBuilder#method.bool_field):[option\_<wbr />bool\_<wbr />as\_<wbr />int](https://docs.kinetica.com/content/api/rust/avro_schema_builder/option_bool_as_int/index.md)[`bool_as_int`](https://docs.kinetica.com/content/api/rust/avro_schema_builder/bool_as_int/index) for an `Option<bool>`, a nullable boolean column.

## Structs

[Avro<wbr />Schema<wbr />Builder](https://docs.kinetica.com/content/api/rust/avro_schema_builder/struct.AvroSchemaBuilder.md)Builder for constructing Avro record schemas programmatically[Kinetica<wbr />Column<wbr />Properties](https://docs.kinetica.com/content/api/rust/avro_schema_builder/struct.KineticaColumnProperties.md)Kinetica column properties[Type<wbr />Properties<wbr />Builder](https://docs.kinetica.com/content/api/rust/avro_schema_builder/struct.TypePropertiesBuilder.md)Builder for Kinetica type properties map

## Enums

[Avro<wbr />Type](https://docs.kinetica.com/content/api/rust/avro_schema_builder/enum.AvroType.md)Avro primitive and complex types supported by Kinetica


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.