Welds
Welds is an async ORM written in rust using sqlx and/or Tiberius.
Features
- Async for all.
- Support for multiple SQL databases (Mssql, MySql, Postgres, Sqlite)
- Written for ease of development. Features aren't hidden behind traits. Code should be simple to write, and simple to read.
- Low level connection always available when you need to drop down to raw SQL.
Under the hood welds uses:
- sqlx for Postgres, MySql, and Sqlite.
- Tiberius for MSSQL
Example Setup
Example Usage
Basic Select
let url = "postgres://postgres:password@localhost:5432";
let client = connect.await.unwrap;
let products = where_col.run.await?;
Basic Filter Across tables
let client = connect.await.unwrap;
let sellers = where_col
.map_query
.where_col
.run.await?;
Create And Update
let client = connect.await.unwrap;
let mut cookies = new;
cookies.name = "cookies".to_owned;
// Creates the product cookie
cookies.save.await?;
cookies.description = "Yum".to_owned;
// Updates the Cookies
cookies.save.await?;
Other Examples
- Basic CRUD
- Mapping Queries / Joining
- Bulk (Create/Update/Delete)
- Select Only Specific Columns
- Checking DB schema matches compiled structs
For more good examples check out the examples repo.