Skip to main content

Schema API Reference

Schemas in Dubhe Engine define the data structure and validation rules for components, providing type-safe data modeling for your blockchain applications.

Schema Configuration

Basic Schema Definition

Supported Data Types

Schema Generation API

CLI Commands

Programmatic API

Component Schema API

Component Definition

Field Types

Advanced Schema Features

Nested Structures

Enumerations

Constraints and Validation

Schema Migration

Version Management

Migration Functions

TypeScript Type Generation

Generated Types

Type Utilities

Schema Validation

Runtime Validation

Custom Validators

Best Practices

Schema Design Guidelines
  1. Keep schemas simple - Avoid overly complex nested structures
  2. Use appropriate types - Choose the smallest type that fits your data
  3. Plan for growth - Design schemas with future features in mind
  4. Version carefully - Use migration scripts for breaking changes
  5. Validate early - Implement validation at the schema level

Performance Considerations

Next Steps

Smart Contracts

Learn to implement schema-based contracts

Client SDK

Use generated types in your frontend