🎨 (seaorm): Mejora API y documentación

- Reescribe la documentación con ejemplos completos, guía rápida y
  tablas de referencia.
- Renombra `connection()` a `dbconn()`.
- Añade `execute()` para SQL en crudo y corrige `fetch_all`/`fetch_one`
  para aceptar `&Q` en lugar de `&mut Q`.
- Cambia `futures::executor::block_on` por `tokio::task::block_in_place`
  para compatibilidad con el *runtime* multi-hilo.
- Los fallos de migración al arrancar provocan `panic!` en lugar de log
  de error silencioso.
- Actualiza `#[pagetop::test]` para usar `flavor = "multi_thread"`,
  alineándolo con `#[pagetop::main]` y con las extensiones que usan
  SeaORM.
This commit is contained in:
Manuel Cillero 2026-06-09 19:22:34 +02:00
parent dfc1bdbc4c
commit 830602b24e
9 changed files with 602 additions and 178 deletions

View file

@ -1,14 +1,14 @@
use futures::Future;
use std::collections::HashSet;
use std::fmt::Display;
use std::future::Future;
use std::pin::Pin;
use std::time::SystemTime;
use pagetop::trace::info;
use sea_orm::sea_query::{
self, extension::postgres::Type, Alias, Expr, ExprTrait, ForeignKey, IntoIden, Order, Query,
SelectStatement, SimpleExpr, Table,
self, Alias, Expr, ExprTrait, ForeignKey, IntoIden, Order, Query, SelectStatement, SimpleExpr,
Table, extension::postgres::Type,
};
use sea_orm::{
ActiveModelTrait, ActiveValue, Condition, ConnectionTrait, DbBackend, DbErr, DeriveIden,
@ -18,10 +18,10 @@ use sea_orm::{
#[allow(unused_imports)]
use sea_schema::probe::SchemaProbe;
use super::{seaql_migrations, IntoSchemaManagerConnection, MigrationTrait, SchemaManager};
use super::{IntoSchemaManagerConnection, MigrationTrait, SchemaManager, seaql_migrations};
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
/// Status of migration
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum MigrationStatus {
/// Not yet applied
Pending,