oxidite-db
Database ORM with relationships and migrations for Oxidite.
Installation
[]
= "0.1"
= { = "1", = ["full"] }
= { = "1", = ["derive"] }
Usage
Define Models
use *;
use ;
Query Data
// Find all
let users = all.await?;
// Find by ID
let user = find.await?;
// Where clause
let user = where_eq.first.await?;
// Create
let user = User ;
user.save.await?;
// Update
user.name = "Jane".to_string;
user.save.await?;
// Delete
user.delete.await?;
Relationships
// Load relationship
let posts = user..await?;
Migrations
use Migration;
;
Features
- Model derive macro
- Relationships (HasOne, HasMany, BelongsTo)
- Migrations with rollback
- Soft deletes
- Timestamps
- Field validation
- Transaction support
License
MIT