---
title: "HeliosDB WASM Procedures: User Guide Index"
---

# HeliosDB WASM Procedures: User Guide Index

:::caution[Planned design: not yet available in the server]
The current `heliosdb-full` server does not run WASM procedures. SQL that
would create or call one fails with SQLSTATE `0A000`. This page describes the
planned design for this upcoming feature. Only the [Go SDK](https://www.heliosdb.com/docs/full/guides/features/wasm_procedures_language_sdks/#go-sdk) is
published. Rust, JavaScript and Python examples are illustrations: no SDK
package exists for those languages. See the
[Quick Start](https://www.heliosdb.com/docs/full/guides/features/wasm_procedures_quick_start/) for what works today.
:::

**Documentation Home > User Guides > Features > WASM Procedures**

---

## Overview

HeliosDB WASM Procedures enable polyglot database programming using WebAssembly. Write stored procedures in **Rust, JavaScript/TypeScript, Python, or Go** with sandboxed execution, capability-based security isolation, and portable WASM modules.

---

## Key Features

- **Polyglot Programming**: Write procedures in 4 languages (Rust, JavaScript/TypeScript, Python, Go)
- **High Performance**: 10x faster execution than traditional interpreted procedures
- **Complete Isolation**: 100% sandboxed execution with capability-based security
- **Universal Compatibility**: Run the same WASM module across any platform
- **Sub-10ms Execution**: Typical operations complete in under 10 ms, fully sandboxed
- **Zero-Downtime Updates**: Hot reload procedures without service interruption

---

## Quick Reference

### Create a Procedure

```sql
-- Planned syntax for the upcoming WASM procedures feature; the current server does not accept it.
CREATE PROCEDURE calculate_discount(
    order_total DECIMAL(10,2),
    tier VARCHAR(20)
)
RETURNS DECIMAL(10,2)
LANGUAGE wasm
SECURITY PROFILE 'standard'
AS '/opt/procedures/discount.wasm';
```

### Call a Procedure

```sql
SELECT calculate_discount(1000.00, 'gold') AS discount;
```

### Performance Comparison

```
Traditional PL/pgSQL:        52ms per call
WASM Procedure (Rust):        6ms per call  (8.7x faster)
WASM Procedure (JavaScript): 11ms per call  (4.7x faster)
WASM Procedure (Python):     14ms per call  (3.7x faster)
WASM Procedure (Go):          8ms per call  (6.5x faster)
```

---

## Complete Guide Sections

This comprehensive user guide has been split into 13 focused sections for easier navigation:

### 1. Introduction
**[WASM_PROCEDURES_INTRO.md](https://www.heliosdb.com/docs/full/guides/features/wasm_procedures_intro/)**

Get an overview of WASM Procedures, understand the key benefits, and learn what polyglot procedures add to database development.

**Topics Covered:**
- What are WASM Procedures?
- Why Polyglot Procedures?
- Key Benefits (Performance, Security, Portability)

**Time to Read**: 10 minutes

---

### 2. Quick Start
**[WASM_PROCEDURES_QUICK_START.md](https://www.heliosdb.com/docs/full/guides/features/wasm_procedures_quick_start/)**

Complete hands-on tutorial to build, deploy, and run your first WASM procedure in all 4 supported languages.

**Topics Covered:**
- Prerequisites and setup
- Rust example (calculate discount)
- JavaScript/TypeScript example
- Python example
- Go example
- Deployment and testing

**Time to Complete**: 20 minutes

---

### 3. Language SDKs
**[WASM_PROCEDURES_LANGUAGE_SDKS.md](https://www.heliosdb.com/docs/full/guides/features/wasm_procedures_language_sdks/)**

Deep dive into SDK documentation for each supported language, including setup, API usage, and best practices.

**Topics Covered:**
- Go SDK (TinyGo), the only published SDK
- Status of Rust, JavaScript and Python (no published SDK)

**Time to Read**: 30 minutes

---

### 4. Host Functions
**[WASM_PROCEDURES_HOST_FUNCTIONS.md](https://www.heliosdb.com/docs/full/guides/features/wasm_procedures_host_functions/)**

Complete reference for all host functions available to WASM procedures, organized by category.

**Topics Covered:**
- Database operations (SQL, transactions, prepared statements)
- Key-Value store operations
- Document store operations
- Graph query operations
- Vector search operations
- HTTP client functions
- Logging and metrics
- Cryptographic functions
- Time and date functions

**Time to Read**: 25 minutes

---

### 5. Security Model
**[WASM_PROCEDURES_SECURITY_MODEL.md](https://www.heliosdb.com/docs/full/guides/features/wasm_procedures_security_model/)**

Understand the security architecture, capability-based permission system, and how to configure security profiles.

**Topics Covered:**
- Capability-based security
- 13 capability types
- Security profiles (restricted, standard, elevated, trusted)
- Resource limits (fuel, memory, time)
- Sandboxing and isolation
- Security best practices

**Time to Read**: 20 minutes

---

### 6. Use Cases
**[WASM_PROCEDURES_USE_CASES.md](https://www.heliosdb.com/docs/full/guides/features/wasm_procedures_use_cases/)**

Real-world examples and production use cases demonstrating the power of WASM procedures.

**Topics Covered:**
- Real-time fraud detection
- Multi-model data processing
- Geospatial analytics with custom algorithms
- Machine learning inference
- Event-driven workflows
- Data validation and transformation
- External API integration
- Time-series analysis

**Time to Read**: 25 minutes

---

### 7. Procedure Management
**[WASM_PROCEDURES_PROCEDURE_MANAGEMENT.md](https://www.heliosdb.com/docs/full/guides/features/wasm_procedures_procedure_management/)**

Complete guide to managing the lifecycle of WASM procedures: creating, updating, versioning, calling, and monitoring.

**Topics Covered:**
- Creating procedures (SQL syntax, examples)
- Updating procedures (hot reload, zero-downtime)
- Dropping procedures
- Calling procedures (SQL, prepared calls, application integration)
- Versioning and version control
- Listing and inspecting procedures

**Time to Read**: 20 minutes

---

### 8. Performance Optimization
**[WASM_PROCEDURES_PERFORMANCE.md](https://www.heliosdb.com/docs/full/guides/features/wasm_procedures_performance/)**

Advanced techniques for optimizing WASM procedure performance, including caching, pooling, and compilation strategies.

**Topics Covered:**
- Module caching configuration
- Instance pooling
- Fuel metering optimization
- Memory management
- Batch operations (10x speedup)
- Compilation tiers (interpreter, baseline, optimizing)
- AOT (Ahead-of-Time) compilation
- Performance benchmarks

**Time to Read**: 25 minutes

---

### 9. Monitoring & Debugging
**[WASM_PROCEDURES_MONITORING.md](https://www.heliosdb.com/docs/full/guides/features/wasm_procedures_monitoring/)**

Comprehensive monitoring, debugging, logging, and profiling capabilities for production operations.

**Topics Covered:**
- Execution metrics (success rate, latency percentiles)
- Real-time monitoring
- Fuel consumption tracking
- Memory usage monitoring
- Error tracking with stack traces
- Logging configuration and best practices
- Profiling and performance analysis
- Debugging techniques
- Alert configuration

**Time to Read**: 25 minutes

---

### 10. Advanced Topics
**[WASM_PROCEDURES_ADVANCED_TOPICS.md](https://www.heliosdb.com/docs/full/guides/features/wasm_procedures_advanced_topics/)**

Advanced patterns and techniques for expert users, including multi-language workflows and custom extensions.

**Topics Covered:**
- Multi-language integration
- Custom host functions
- Sandboxing deep dive
- WASM module optimization (size reduction, SIMD)
- CI/CD integration (GitHub Actions)
- Testing strategies
- Advanced security patterns

**Time to Read**: 30 minutes

---

### 11. Migration Guide
**[WASM_PROCEDURES_MIGRATION_GUIDE.md](https://www.heliosdb.com/docs/full/guides/features/wasm_procedures_migration_guide/)**

Practical guide for migrating existing database procedures to WASM, with before/after examples.

**Topics Covered:**
- PL/pgSQL to Rust migration
- JavaScript UDFs to AssemblyScript
- Performance comparison table
- Migration strategies (gradual, A/B testing, shadow mode)
- Common migration patterns
- Migration checklist

**Time to Read**: 20 minutes

---

### 12. API Reference
**[WASM_PROCEDURES_API_REFERENCE.md](https://www.heliosdb.com/docs/full/guides/features/wasm_procedures_api_reference/)**

Complete API reference for SQL statements, host functions, system catalogs, and configuration parameters.

**Topics Covered:**
- SQL statements (CREATE, ALTER, DROP, CALL)
- Host function reference (40+ functions)
- Error codes
- System catalogs (metrics, errors, logs, cache stats)
- Configuration parameters
- Quick reference

**Time to Read**: 15 minutes

---

### 13. Conclusion
**[WASM_PROCEDURES_CONCLUSION.md](https://www.heliosdb.com/docs/full/guides/features/wasm_procedures_conclusion/)**

Summary of innovations, getting started steps, resources, and links to community support.

**Topics Covered:**
- Key capabilities
- Production readiness
- Performance and security benefits
- Getting started roadmap
- Resources and links
- Related features
- Future of database procedures

**Time to Read**: 10 minutes

---

## Recommended Reading Path

### For New Users (Getting Started)
1. [Introduction](https://www.heliosdb.com/docs/full/guides/features/wasm_procedures_intro/) - Understand the feature
2. [Quick Start](https://www.heliosdb.com/docs/full/guides/features/wasm_procedures_quick_start/) - Build your first procedure
3. [Use Cases](https://www.heliosdb.com/docs/full/guides/features/wasm_procedures_use_cases/) - See real-world examples
4. [Procedure Management](https://www.heliosdb.com/docs/full/guides/features/wasm_procedures_procedure_management/) - Learn lifecycle management

### For Developers (Implementation)
1. [Language SDKs](https://www.heliosdb.com/docs/full/guides/features/wasm_procedures_language_sdks/) - Choose your SDK
2. [Host Functions](https://www.heliosdb.com/docs/full/guides/features/wasm_procedures_host_functions/) - Learn available APIs
3. [Security Model](https://www.heliosdb.com/docs/full/guides/features/wasm_procedures_security_model/) - Configure security
4. [Performance](https://www.heliosdb.com/docs/full/guides/features/wasm_procedures_performance/) - Optimize procedures

### For Operations (Production)
1. [Monitoring & Debugging](https://www.heliosdb.com/docs/full/guides/features/wasm_procedures_monitoring/) - Observability tools
2. [Performance](https://www.heliosdb.com/docs/full/guides/features/wasm_procedures_performance/) - Tuning and optimization
3. [Security Model](https://www.heliosdb.com/docs/full/guides/features/wasm_procedures_security_model/) - Security configuration
4. [API Reference](https://www.heliosdb.com/docs/full/guides/features/wasm_procedures_api_reference/) - System catalogs

### For Migrating Users
1. [Migration Guide](https://www.heliosdb.com/docs/full/guides/features/wasm_procedures_migration_guide/) - Migration strategies
2. [Language SDKs](https://www.heliosdb.com/docs/full/guides/features/wasm_procedures_language_sdks/) - SDK comparison
3. [Performance](https://www.heliosdb.com/docs/full/guides/features/wasm_procedures_performance/) - Performance benefits
4. [Advanced Topics](https://www.heliosdb.com/docs/full/guides/features/wasm_procedures_advanced_topics/) - Advanced patterns

### For Advanced Users
1. [Advanced Topics](https://www.heliosdb.com/docs/full/guides/features/wasm_procedures_advanced_topics/) - Advanced patterns
2. [Performance](https://www.heliosdb.com/docs/full/guides/features/wasm_procedures_performance/) - Deep optimization
3. [Monitoring](https://www.heliosdb.com/docs/full/guides/features/wasm_procedures_monitoring/) - Advanced monitoring
4. [API Reference](https://www.heliosdb.com/docs/full/guides/features/wasm_procedures_api_reference/) - Complete API

---

## External Resources

### Community and Support
- **Documentation Portal**: [https://www.heliosdb.com/docs/full/](https://www.heliosdb.com/docs/full/)
- Community: [Discord](https://discord.gg/yTykuUrFXc)
- **Email Support**: support@heliosdb.com

### Related Documentation
- [Self-Healing Database Guide](https://www.heliosdb.com/docs/full/guides/features/self_healing_database_guide/)
- [Distributed Query Optimization](https://www.heliosdb.com/docs/full/guides/features/distributed_query_optimization/)

### SDK Repositories
- Official client SDKs: [HeliosDatabase/HeliosDB-SDKs](https://github.com/HeliosDatabase/HeliosDB-SDKs)

---

## Document Information

**Supported Languages**: Rust, JavaScript/TypeScript, Python, Go
**Total Documentation Size**: 19,500+ words across 13 sections

---

**Navigation:** Documentation Home | User Guides | Features
