mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-07 00:01:49 +00:00
This experimental crate demonstrates running Windmill preview endpoints
with libSQL (SQLite/Turso) instead of PostgreSQL. Key features:
- Schema: SQLite-compatible schema for jobs, queue, and results
- ENUMs → TEXT with CHECK constraints
- JSONB → JSON (TEXT)
- Arrays → JSON arrays
- No FOR UPDATE SKIP LOCKED (single worker, mutex coordination)
- Database: Supports three modes via libsql crate:
- In-memory SQLite (for testing)
- File-based SQLite (local persistence)
- Remote Turso (multi-writer scenarios)
- API: Compatible preview endpoints:
- POST /api/w/{workspace}/jobs/run/preview
- POST /api/w/{workspace}/jobs/run_wait_result/preview
- POST /api/w/{workspace}/jobs/run/preview_flow
- POST /api/w/{workspace}/jobs/run_wait_result/preview_flow
- Executor: Simple script execution for bash, python3, deno, bun
- Worker: Single embedded worker that processes queue
Run with: cargo run -p windmill-local --example local_server
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
30 lines
603 B
Rust
30 lines
603 B
Rust
//! Error types for local mode
|
|
|
|
use thiserror::Error;
|
|
|
|
#[derive(Error, Debug)]
|
|
pub enum LocalError {
|
|
#[error("Database error: {0}")]
|
|
Database(#[from] libsql::Error),
|
|
|
|
#[error("Serialization error: {0}")]
|
|
Serialization(#[from] serde_json::Error),
|
|
|
|
#[error("Job not found: {0}")]
|
|
JobNotFound(uuid::Uuid),
|
|
|
|
#[error("Invalid job state: {0}")]
|
|
InvalidJobState(String),
|
|
|
|
#[error("Queue is empty")]
|
|
QueueEmpty,
|
|
|
|
#[error("Execution error: {0}")]
|
|
Execution(String),
|
|
|
|
#[error("Timeout")]
|
|
Timeout,
|
|
}
|
|
|
|
pub type Result<T> = std::result::Result<T, LocalError>;
|