salvo-database

Integrate relational databases with Salvo-based Rust services using SQLx, SeaORM, or Diesel.

1|Updated Mar 16, 2024
One-click install
npx skills add https://github.com/tdcare/genies --skill salvo-database-tdcare
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: salvo-database
Source: https://github.com/tdcare/genies/tree/main/.qoder/skills/salvo-database
Command: npx skills add https://github.com/tdcare/genies --skill salvo-database-tdcare

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Integrate databases with Salvo-based Rust services using SQLx, SeaORM, Diesel, or other ORMs to enable persistent storage, data modeling, and transactional workflows.

Core Features & Use Cases

  • ORM-driven data access: Connect to Postgres, MySQL, or SQLite using SQLx, SeaORM, or Diesel and perform CRUD operations in Salvo routes.
  • Transaction support: Coordinate multi-step operations with atomic commits to maintain data integrity.
  • Schema evolution: Leverage migrations and schema management alongside Salvo's DI patterns to keep models in sync.
  • Use Case: Build a user service with create/read/update/delete endpoints backed by a relational database.

Quick Start

Configure a Salvo project to connect a database using SQLx or SeaORM, and perform a sample CRUD operation.

Frequently Asked Questions about salvo-database

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I integrate a relational database with Salvo in Rust?

To integrate a relational database with Salvo, you can use SQLx, SeaORM, or Diesel to establish connections, perform CRUD operations in router handlers, and manage transactional data workflows. This enables persistent storage for microservices.

Does Salvo support connection pooling and dependency injection for ORM data models?

Yes, Salvo supports dependency injection patterns for ORM-defined data models. You can configure connection pooling and inject database connections directly into your router handlers to manage transactional operations.

What's the best way to handle database transactions and schema migrations in a Salvo service?

The best way to handle database transactions and schema migrations in a Salvo service is using a Rust ORM like SQLx or SeaORM. These provide atomic multi-step transaction commits and schema management to keep models synchronized.

Can I build a CRUD user service using SQLx or SeaORM with the Salvo framework?

Yes, you can build a CRUD user service using SQLx or SeaORM with Salvo. This setup enables you to connect to Postgres, MySQL, or SQLite and perform create, read, update, and delete endpoints backed by relational databases.

How do I manage schema evolution and migrations alongside Salvo's dependency injection patterns?

You manage schema evolution by leveraging ORM migrations and schema management alongside Salvo's dependency injection patterns. This ensures your relational data models remain in sync with your database schema during microservice development.