repo stringlengths 6 65 | file_url stringlengths 81 311 | file_path stringlengths 6 227 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:31:58 2026-01-04 20:25:31 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/sea-orm-sync/tests/crud/updates.rs | sea-orm-sync/tests/crud/updates.rs | pub use super::*;
use sea_orm::{DbErr, query::*};
use uuid::Uuid;
pub fn test_update_cake(db: &DbConn) {
let seaside_bakery = bakery::ActiveModel {
name: Set("SeaSide Bakery".to_owned()),
profit_margin: Set(10.4),
..Default::default()
};
let bakery_insert_res = Bakery::insert(seasid... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/sea-orm-sync/tests/crud/create_cake.rs | sea-orm-sync/tests/crud/create_cake.rs | pub use super::*;
use uuid::Uuid;
pub fn test_create_cake(db: &DbConn) {
let seaside_bakery = bakery::ActiveModel {
name: Set("SeaSide Bakery".to_owned()),
profit_margin: Set(10.4),
..Default::default()
};
let bakery_insert_res = Bakery::insert(seaside_bakery)
.exec(db)
... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/sea-orm-sync/tests/crud/create_lineitem.rs | sea-orm-sync/tests/crud/create_lineitem.rs | pub use super::*;
use sea_orm::entity::prelude::{ChronoUtc, Uuid};
pub fn test_create_lineitem(db: &DbConn) {
// Bakery
let seaside_bakery = bakery::ActiveModel {
name: Set("SeaSide Bakery".to_owned()),
profit_margin: Set(10.4),
..Default::default()
};
let bakery_insert_res = Ba... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/sea-orm-sync/examples/pi_spigot/src/main.rs | sea-orm-sync/examples/pi_spigot/src/main.rs | use std::io::Write as _;
/// SeaORM Entity for state persistence
mod state {
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[sea_orm::model]
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)]
#[sea_orm(table_name = "state")]
pub struct Model {
#[sea_orm(p... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/sea-orm-sync/examples/quickstart/src/main.rs | sea-orm-sync/examples/quickstart/src/main.rs | use log::info;
mod user {
use sea_orm::entity::prelude::*;
#[sea_orm::model]
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)]
#[sea_orm(table_name = "user")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
pub name: String,
#[sea_orm(unique)]
... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/sea-orm-rocket/codegen/src/lib.rs | sea-orm-rocket/codegen/src/lib.rs | #![recursion_limit = "256"]
#![warn(rust_2018_idioms)]
//! # `sea_orm_rocket` - Code Generation
//!
//! Implements the code generation portion of the `sea_orm_rocket` crate. This
//! is an implementation detail. This create should never be depended on
//! directly.
#[macro_use]
extern crate quote;
mod database;
///... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/sea-orm-rocket/codegen/src/database.rs | sea-orm-rocket/codegen/src/database.rs | use proc_macro::TokenStream;
use devise::proc_macro2_diagnostics::SpanDiagnosticExt;
use devise::syn::{self, spanned::Spanned};
use devise::{DeriveGenerator, FromMeta, MapperBuild, Support, ValidatorBuild};
const ONE_DATABASE_ATTR: &str = "missing `#[database(\"name\")]` attribute";
const ONE_UNNAMED_FIELD: &str = "s... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/sea-orm-rocket/lib/src/config.rs | sea-orm-rocket/lib/src/config.rs | use rocket::serde::{Deserialize, Serialize};
/// Base configuration for all database drivers.
///
/// A dictionary matching this structure is extracted from the active
/// [`Figment`](crate::figment::Figment), scoped to `databases.name`, where
/// `name` is the name of the database, by the
/// [`Initializer`](crate::I... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/sea-orm-rocket/lib/src/lib.rs | sea-orm-rocket/lib/src/lib.rs | //! SeaORM Rocket support crate.
#![deny(missing_docs)]
/// Re-export of the `figment` crate.
#[doc(inline)]
pub use rocket::figment;
pub use rocket;
mod config;
mod database;
mod error;
mod pool;
pub use self::config::Config;
pub use self::database::{Connection, Database, Initializer};
pub use self::error::Error;
... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/sea-orm-rocket/lib/src/database.rs | sea-orm-rocket/lib/src/database.rs | use std::marker::PhantomData;
use std::ops::DerefMut;
use rocket::fairing::{self, Fairing, Info, Kind};
use rocket::http::Status;
use rocket::request::{FromRequest, Outcome, Request};
use rocket::{Build, Ignite, Phase, Rocket, Sentinel, error, info_};
use rocket::figment::providers::Serialized;
use rocket::yansi::Pai... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/sea-orm-rocket/lib/src/error.rs | sea-orm-rocket/lib/src/error.rs | use std::fmt;
/// A general error type for use by [`Pool`](crate::Pool#implementing)
/// implementors and returned by the [`Connection`](crate::Connection) request
/// guard.
#[derive(Debug)]
pub enum Error<A, B = A> {
/// An error that occurred during database/pool initialization.
Init(A),
/// An error t... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/sea-orm-rocket/lib/src/pool.rs | sea-orm-rocket/lib/src/pool.rs | use rocket::figment::Figment;
/// Generic [`Database`](crate::Database) driver connection pool trait.
///
/// This trait provides a generic interface to various database pooling
/// implementations in the Rust ecosystem. It can be implemented by anyone.
///
/// This is adapted from the original `rocket_db_pools`. But ... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/seaography_example/graphql/src/query_root.rs | examples/seaography_example/graphql/src/query_root.rs | use crate::entities::*;
use async_graphql::dynamic::*;
use sea_orm::DatabaseConnection;
use seaography::{async_graphql, lazy_static::lazy_static, Builder, BuilderContext};
lazy_static! {
static ref CONTEXT: BuilderContext = BuilderContext::default();
}
pub fn schema(
database: DatabaseConnection,
depth: O... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/seaography_example/graphql/src/lib.rs | examples/seaography_example/graphql/src/lib.rs | pub mod entities;
pub mod query_root;
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/seaography_example/graphql/src/main.rs | examples/seaography_example/graphql/src/main.rs | use async_graphql::{
dynamic::Schema,
http::{playground_source, GraphQLPlaygroundConfig},
};
use async_graphql_axum::{GraphQLRequest, GraphQLResponse};
use axum::{
extract::State,
response::{self, IntoResponse},
routing::get,
Router,
};
use dotenv::dotenv;
use sea_orm::Database;
use seaography::... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/seaography_example/graphql/src/entities/prelude.rs | examples/seaography_example/graphql/src/entities/prelude.rs | //! `SeaORM` Entity, @generated by sea-orm-codegen 2.0.0-rc.14
pub use super::baker::Entity as Baker;
pub use super::bakery::Entity as Bakery;
pub use super::cake::Entity as Cake;
pub use super::cake_baker::Entity as CakeBaker;
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/seaography_example/graphql/src/entities/baker.rs | examples/seaography_example/graphql/src/entities/baker.rs | //! `SeaORM` Entity, @generated by sea-orm-codegen 2.0.0-rc.14
use sea_orm::entity::prelude::*;
#[sea_orm::model]
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)]
#[sea_orm(table_name = "baker")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
pub name: String,
pub contact: String,
... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/seaography_example/graphql/src/entities/cake_baker.rs | examples/seaography_example/graphql/src/entities/cake_baker.rs | //! `SeaORM` Entity, @generated by sea-orm-codegen 2.0.0-rc.14
use sea_orm::entity::prelude::*;
#[sea_orm::model]
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)]
#[sea_orm(table_name = "cake_baker")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub cake_id: i32,
#[sea_orm(p... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/seaography_example/graphql/src/entities/cake.rs | examples/seaography_example/graphql/src/entities/cake.rs | //! `SeaORM` Entity, @generated by sea-orm-codegen 2.0.0-rc.14
use sea_orm::entity::prelude::*;
#[sea_orm::model]
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)]
#[sea_orm(table_name = "cake")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
pub name: String,
#[sea_orm(column_type = ... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/seaography_example/graphql/src/entities/bakery.rs | examples/seaography_example/graphql/src/entities/bakery.rs | //! `SeaORM` Entity, @generated by sea-orm-codegen 2.0.0-rc.14
use sea_orm::entity::prelude::*;
#[sea_orm::model]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel)]
#[sea_orm(table_name = "bakery")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
pub name: String,
#[sea_orm(column_type = "D... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/seaography_example/graphql/src/entities/mod.rs | examples/seaography_example/graphql/src/entities/mod.rs | //! `SeaORM` Entity, @generated by sea-orm-codegen 2.0.0-rc.14
pub mod prelude;
pub mod baker;
pub mod bakery;
pub mod cake;
pub mod cake_baker;
seaography::register_entity_modules!([baker, bakery, cake, cake_baker,]);
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/seaography_example/graphql/tests/query_tests.rs | examples/seaography_example/graphql/tests/query_tests.rs | use async_graphql::{dynamic::*, Response};
use sea_orm::Database;
use seaography::async_graphql;
async fn schema() -> Schema {
let database = Database::connect(
std::env::var("DATABASE_URL").unwrap_or_else(|_| "sqlite://../bakery.db".into()),
)
.await
.unwrap();
sea_orm_seaography_example::... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/seaography_example/migration/src/m20230101_000001_create_bakery_table.rs | examples/seaography_example/migration/src/m20230101_000001_create_bakery_table.rs | use sea_orm_migration::{prelude::*, schema::*};
#[derive(DeriveMigrationName)]
pub struct Migration;
#[async_trait::async_trait]
impl MigrationTrait for Migration {
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
manager
.create_table(
Table::create()
... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/seaography_example/migration/src/m20230101_000003_create_cake_table.rs | examples/seaography_example/migration/src/m20230101_000003_create_cake_table.rs | use sea_orm_migration::{prelude::*, schema::*};
#[derive(DeriveMigrationName)]
pub struct Migration;
#[async_trait::async_trait]
impl MigrationTrait for Migration {
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
manager
.create_table(
Table::create()
... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/seaography_example/migration/src/lib.rs | examples/seaography_example/migration/src/lib.rs | pub use sea_orm_migration::prelude::*;
mod entity;
mod m20230101_000001_create_bakery_table;
mod m20230101_000002_create_baker_table;
mod m20230101_000003_create_cake_table;
mod m20230101_000004_create_cake_baker_table;
mod m20230101_000005_create_customer_table;
mod m20230101_000006_create_order_table;
mod m20230101_... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/seaography_example/migration/src/m20230101_000006_create_order_table.rs | examples/seaography_example/migration/src/m20230101_000006_create_order_table.rs | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false | |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/seaography_example/migration/src/m20230102_000001_seed_bakery_data.rs | examples/seaography_example/migration/src/m20230102_000001_seed_bakery_data.rs | use crate::entity::{prelude::*, *};
use sea_orm::entity::*;
use sea_orm_migration::prelude::*;
#[derive(DeriveMigrationName)]
pub struct Migration;
#[async_trait::async_trait]
impl MigrationTrait for Migration {
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
let db = manager.get_connec... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/seaography_example/migration/src/m20230101_000004_create_cake_baker_table.rs | examples/seaography_example/migration/src/m20230101_000004_create_cake_baker_table.rs | use sea_orm_migration::{prelude::*, schema::*};
#[derive(DeriveMigrationName)]
pub struct Migration;
#[async_trait::async_trait]
impl MigrationTrait for Migration {
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
manager
.create_table(
Table::create()
... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/seaography_example/migration/src/m20230101_000007_create_lineitem_table.rs | examples/seaography_example/migration/src/m20230101_000007_create_lineitem_table.rs | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false | |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/seaography_example/migration/src/main.rs | examples/seaography_example/migration/src/main.rs | use sea_orm_migration::prelude::*;
#[tokio::main]
async fn main() {
cli::run_cli(migration::Migrator).await;
}
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/seaography_example/migration/src/m20230101_000002_create_baker_table.rs | examples/seaography_example/migration/src/m20230101_000002_create_baker_table.rs | use sea_orm_migration::{prelude::*, schema::*};
#[derive(DeriveMigrationName)]
pub struct Migration;
#[async_trait::async_trait]
impl MigrationTrait for Migration {
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
manager
.create_table(
Table::create()
... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/seaography_example/migration/src/m20230101_000005_create_customer_table.rs | examples/seaography_example/migration/src/m20230101_000005_create_customer_table.rs | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false | |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/seaography_example/migration/src/entity/prelude.rs | examples/seaography_example/migration/src/entity/prelude.rs | //! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1
pub use super::baker::Entity as Baker;
pub use super::bakery::Entity as Bakery;
pub use super::cake::Entity as Cake;
pub use super::cake_baker::Entity as CakeBaker;
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/seaography_example/migration/src/entity/baker.rs | examples/seaography_example/migration/src/entity/baker.rs | //! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1
use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)]
#[sea_orm(table_name = "baker")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
pub name: String,
pub contact: String,
pub bakery_id: Option<... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/seaography_example/migration/src/entity/cake_baker.rs | examples/seaography_example/migration/src/entity/cake_baker.rs | //! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1
use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)]
#[sea_orm(table_name = "cake_baker")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub cake_id: i32,
#[sea_orm(primary_key, auto_increme... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/seaography_example/migration/src/entity/cake.rs | examples/seaography_example/migration/src/entity/cake.rs | //! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1
use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)]
#[sea_orm(table_name = "cake")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
pub name: String,
#[sea_orm(column_type = "Decimal(Some((16, 4)))"... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/seaography_example/migration/src/entity/bakery.rs | examples/seaography_example/migration/src/entity/bakery.rs | //! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1
use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel)]
#[sea_orm(table_name = "bakery")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
pub name: String,
#[sea_orm(column_type = "Double")]
pub profit_... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/seaography_example/migration/src/entity/mod.rs | examples/seaography_example/migration/src/entity/mod.rs | //! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1
pub mod prelude;
pub mod baker;
pub mod bakery;
pub mod cake;
pub mod cake_baker;
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/rocket_example/src/main.rs | examples/rocket_example/src/main.rs | fn main() {
rocket_example_api::main();
}
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/rocket_example/api/src/lib.rs | examples/rocket_example/api/src/lib.rs | #[macro_use]
extern crate rocket;
use rocket::fairing::{self, AdHoc};
use rocket::form::{Context, Form};
use rocket::fs::{FileServer, relative};
use rocket::request::FlashMessage;
use rocket::response::{Flash, Redirect};
use rocket::{Build, Request, Rocket};
use rocket_dyn_templates::Template;
use serde_json::json;
u... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/rocket_example/api/src/pool.rs | examples/rocket_example/api/src/pool.rs | use async_trait::async_trait;
use rocket_db_pools::Database;
use sea_orm::ConnectOptions;
use sea_orm_rocket::{Config, rocket::figment::Figment};
use std::time::Duration;
#[derive(Database, Debug)]
#[database("sea_orm")]
pub struct Db(SeaOrmPool);
#[derive(Debug, Clone)]
pub struct SeaOrmPool {
pub conn: sea_orm:... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/rocket_example/api/src/service/mutation.rs | examples/rocket_example/api/src/service/mutation.rs | use entity::{post, post::Entity as Post};
use sea_orm::{DbConn, DbErr, DeleteResult, entity::*};
pub struct Mutation;
impl Mutation {
pub async fn create_post(
db: &DbConn,
form_data: post::Model,
) -> Result<post::ActiveModel, DbErr> {
post::ActiveModel {
title: Set(form_d... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/rocket_example/api/src/service/mod.rs | examples/rocket_example/api/src/service/mod.rs | mod mutation;
mod query;
pub use mutation::*;
pub use query::*;
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/rocket_example/api/src/service/query.rs | examples/rocket_example/api/src/service/query.rs | use entity::{post, post::Entity as Post};
use sea_orm::{DbConn, DbErr, EntityTrait, PaginatorTrait, QueryOrder};
pub struct Query;
impl Query {
pub async fn find_post_by_id(db: &DbConn, id: i32) -> Result<Option<post::Model>, DbErr> {
Post::find_by_id(id).one(db).await
}
/// If ok, returns (post ... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/rocket_example/api/tests/crud_tests.rs | examples/rocket_example/api/tests/crud_tests.rs | use entity::post;
use rocket_example_api::service::{Mutation, Query};
use sea_orm::Database;
#[tokio::test]
async fn crud_tests() {
let db = &Database::connect("sqlite::memory:").await.unwrap();
db.get_schema_builder()
.register(post::Entity)
.apply(db)
.await
.unwrap();
{... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/rocket_example/entity/src/lib.rs | examples/rocket_example/entity/src/lib.rs | #[macro_use]
extern crate rocket;
pub mod post;
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/rocket_example/entity/src/post.rs | examples/rocket_example/entity/src/post.rs | use rocket::serde::{Deserialize, Serialize};
use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel, Deserialize, Serialize, FromForm)]
#[serde(crate = "rocket::serde")]
#[sea_orm(table_name = "post")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
pub title: Stri... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/rocket_example/migration/src/lib.rs | examples/rocket_example/migration/src/lib.rs | pub use sea_orm_migration::prelude::*;
mod m20220120_000001_create_post_table;
mod m20220120_000002_seed_posts;
pub struct Migrator;
#[async_trait::async_trait]
impl MigratorTrait for Migrator {
fn migrations() -> Vec<Box<dyn MigrationTrait>> {
vec![
Box::new(m20220120_000001_create_post_tabl... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/rocket_example/migration/src/m20220120_000002_seed_posts.rs | examples/rocket_example/migration/src/m20220120_000002_seed_posts.rs | use entity::post;
use sea_orm::{ActiveModelTrait, ColumnTrait, EntityTrait, QueryFilter, Set};
use sea_orm_migration::prelude::*;
#[derive(DeriveMigrationName)]
pub struct Migration;
#[async_trait::async_trait]
impl MigrationTrait for Migration {
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/rocket_example/migration/src/m20220120_000001_create_post_table.rs | examples/rocket_example/migration/src/m20220120_000001_create_post_table.rs | use sea_orm_migration::{prelude::*, schema::*};
#[derive(DeriveMigrationName)]
pub struct Migration;
#[async_trait::async_trait]
impl MigrationTrait for Migration {
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
manager
.create_table(
Table::create()
... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/rocket_example/migration/src/main.rs | examples/rocket_example/migration/src/main.rs | use sea_orm_migration::prelude::*;
#[tokio::main]
async fn main() {
cli::run_cli(migration::Migrator).await;
}
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/loco_starter/src/app.rs | examples/loco_starter/src/app.rs | use std::path::Path;
use async_trait::async_trait;
use loco_rs::{
Result,
app::{AppContext, Hooks},
bgworker::{BackgroundWorker, Queue},
boot::{BootResult, StartMode, create_app},
config::Config,
controller::AppRoutes,
db::{self, truncate_table},
environment::Environment,
task::Task... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/loco_starter/src/lib.rs | examples/loco_starter/src/lib.rs | pub mod app;
pub mod controllers;
pub mod mailers;
pub mod models;
pub mod tasks;
pub mod views;
pub mod workers;
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/loco_starter/src/tasks/seed.rs | examples/loco_starter/src/tasks/seed.rs | //! This task implements data seeding functionality for initializing new
//! development/demo environments.
//!
//! # Example
//!
//! Run the task with the following command:
//! ```sh
//! cargo run task
//! ```
//!
//! To override existing data and reset the data structure, use the following
//! command with the `refr... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/loco_starter/src/tasks/mod.rs | examples/loco_starter/src/tasks/mod.rs | pub mod seed;
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/loco_starter/src/workers/downloader.rs | examples/loco_starter/src/workers/downloader.rs | use std::time::Duration;
use loco_rs::prelude::*;
use serde::{Deserialize, Serialize};
use tokio::time::sleep;
use crate::models::users;
pub struct DownloadWorker {
pub ctx: AppContext,
}
#[derive(Deserialize, Debug, Serialize)]
pub struct DownloadWorkerArgs {
pub user_guid: String,
}
#[async_trait]
impl B... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/loco_starter/src/workers/mod.rs | examples/loco_starter/src/workers/mod.rs | pub mod downloader;
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/loco_starter/src/controllers/user.rs | examples/loco_starter/src/controllers/user.rs | use axum::debug_handler;
use loco_rs::prelude::*;
use crate::{models::_entities::users, views::user::CurrentResponse};
#[debug_handler]
async fn current(auth: auth::JWT, State(ctx): State<AppContext>) -> Result<Response> {
let user = users::Model::find_by_pid(&ctx.db, &auth.claims.pid).await?;
format::json(Cu... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/loco_starter/src/controllers/auth.rs | examples/loco_starter/src/controllers/auth.rs | use axum::debug_handler;
use loco_rs::prelude::*;
use serde::{Deserialize, Serialize};
use crate::{
mailers::auth::AuthMailer,
models::{
_entities::users,
users::{LoginParams, RegisterParams},
},
views::auth::LoginResponse,
};
#[derive(Debug, Deserialize, Serialize)]
pub struct VerifyPa... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/loco_starter/src/controllers/mod.rs | examples/loco_starter/src/controllers/mod.rs | pub mod auth;
pub mod files;
pub mod notes;
pub mod user;
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/loco_starter/src/controllers/notes.rs | examples/loco_starter/src/controllers/notes.rs | #![allow(clippy::missing_errors_doc)]
#![allow(clippy::unnecessary_struct_initialization)]
#![allow(clippy::unused_async)]
use axum::debug_handler;
use loco_rs::prelude::*;
use serde::{Deserialize, Serialize};
use crate::models::_entities::notes::{ActiveModel, Entity, Model};
#[derive(Clone, Debug, Serialize, Deseria... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/loco_starter/src/controllers/files.rs | examples/loco_starter/src/controllers/files.rs | #![allow(clippy::missing_errors_doc)]
#![allow(clippy::unnecessary_struct_initialization)]
#![allow(clippy::unused_async)]
use std::path::PathBuf;
use axum::{body::Body, debug_handler, extract::Multipart};
use loco_rs::prelude::*;
use sea_orm::QueryOrder;
use tokio::{fs, io::AsyncWriteExt};
use tokio_util::io::ReaderS... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/loco_starter/src/models/users.rs | examples/loco_starter/src/models/users.rs | use async_trait::async_trait;
use chrono::offset::Local;
use loco_rs::{auth::jwt, hash, prelude::*};
use serde::{Deserialize, Serialize};
use uuid::Uuid;
pub use super::_entities::users::{self, ActiveModel, Entity, Model};
#[derive(Debug, Deserialize, Serialize)]
pub struct LoginParams {
pub email: String,
pu... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/loco_starter/src/models/mod.rs | examples/loco_starter/src/models/mod.rs | pub mod _entities;
pub mod files;
pub mod notes;
pub mod users;
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/loco_starter/src/models/notes.rs | examples/loco_starter/src/models/notes.rs | use sea_orm::entity::prelude::*;
use super::_entities::notes::ActiveModel;
impl ActiveModelBehavior for ActiveModel {
// extend activemodel below (keep comment for generators)
}
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/loco_starter/src/models/files.rs | examples/loco_starter/src/models/files.rs | use sea_orm::entity::prelude::*;
use super::_entities::files::ActiveModel;
impl ActiveModelBehavior for ActiveModel {
// extend activemodel below (keep comment for generators)
}
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/loco_starter/src/models/_entities/prelude.rs | examples/loco_starter/src/models/_entities/prelude.rs | pub use super::{notes::Entity as Notes, users::Entity as Users};
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/loco_starter/src/models/_entities/users.rs | examples/loco_starter/src/models/_entities/users.rs | use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel, Serialize, Deserialize)]
#[sea_orm(table_name = "users")]
pub struct Model {
pub created_at: DateTime,
pub updated_at: DateTime,
#[sea_orm(primary_key)]
pub id: i32,
#[sea_... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/loco_starter/src/models/_entities/mod.rs | examples/loco_starter/src/models/_entities/mod.rs | pub mod prelude;
pub mod files;
pub mod notes;
pub mod users;
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/loco_starter/src/models/_entities/notes.rs | examples/loco_starter/src/models/_entities/notes.rs | //! `SeaORM` Entity, @generated by sea-orm-codegen 2.0.0-rc.10
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[sea_orm::model]
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel, Serialize, Deserialize)]
#[sea_orm(table_name = "notes")]
pub struct Model {
pub created_at: DateTime,
... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/loco_starter/src/models/_entities/files.rs | examples/loco_starter/src/models/_entities/files.rs | use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel, Serialize, Deserialize)]
#[sea_orm(table_name = "files")]
pub struct Model {
pub created_at: DateTime,
pub updated_at: DateTime,
#[sea_orm(primary_key)]
pub id: i32,
pub no... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/loco_starter/src/views/user.rs | examples/loco_starter/src/views/user.rs | use serde::{Deserialize, Serialize};
use crate::models::_entities::users;
#[derive(Debug, Deserialize, Serialize)]
pub struct CurrentResponse {
pub pid: String,
pub name: String,
pub email: String,
}
impl CurrentResponse {
#[must_use]
pub fn new(user: &users::Model) -> Self {
Self {
... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/loco_starter/src/views/auth.rs | examples/loco_starter/src/views/auth.rs | use serde::{Deserialize, Serialize};
use crate::models::_entities::users;
#[derive(Debug, Deserialize, Serialize)]
pub struct LoginResponse {
pub token: String,
pub pid: String,
pub name: String,
pub is_verified: bool,
}
impl LoginResponse {
#[must_use]
pub fn new(user: &users::Model, token: ... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/loco_starter/src/views/mod.rs | examples/loco_starter/src/views/mod.rs | pub mod auth;
pub mod user;
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/loco_starter/src/bin/main.rs | examples/loco_starter/src/bin/main.rs | use loco_rs::cli;
use loco_starter::app::App;
use migration::Migrator;
#[tokio::main]
async fn main() -> eyre::Result<()> {
cli::main::<App, Migrator>().await?;
Ok(())
}
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/loco_starter/src/mailers/auth.rs | examples/loco_starter/src/mailers/auth.rs | // auth mailer
#![allow(non_upper_case_globals)]
use loco_rs::prelude::*;
use serde_json::json;
use crate::models::users;
static welcome: Dir<'_> = include_dir!("src/mailers/auth/welcome");
static forgot: Dir<'_> = include_dir!("src/mailers/auth/forgot");
// #[derive(Mailer)] // -- disabled for faster build speed. i... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/loco_starter/src/mailers/mod.rs | examples/loco_starter/src/mailers/mod.rs | pub mod auth;
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/loco_starter/examples/playground.rs | examples/loco_starter/examples/playground.rs | use eyre::Context;
#[allow(unused_imports)]
use loco_rs::{cli::playground, prelude::*};
use loco_starter::app::App;
#[tokio::main]
async fn main() -> eyre::Result<()> {
let _ctx = playground::<App>().await.context("playground")?;
// let active_model: articles::ActiveModel = ActiveModel {
// title: Set... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/loco_starter/migration/src/m20240520_173001_files.rs | examples/loco_starter/migration/src/m20240520_173001_files.rs | use sea_orm_migration::{prelude::*, schema::*};
#[derive(DeriveMigrationName)]
pub struct Migration;
#[async_trait::async_trait]
impl MigrationTrait for Migration {
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
manager
.create_table(
table_auto("files")
... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/loco_starter/migration/src/lib.rs | examples/loco_starter/migration/src/lib.rs | #![allow(elided_lifetimes_in_paths)]
#![allow(clippy::wildcard_imports)]
pub use sea_orm_migration::prelude::*;
mod m20220101_000001_users;
mod m20231103_114510_notes;
mod m20240520_173001_files;
pub struct Migrator;
#[async_trait::async_trait]
impl MigratorTrait for Migrator {
fn migrations() -> Vec<Box<dyn Mig... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/loco_starter/migration/src/m20220101_000001_users.rs | examples/loco_starter/migration/src/m20220101_000001_users.rs | use sea_orm_migration::{prelude::*, schema::*};
#[derive(DeriveMigrationName)]
pub struct Migration;
#[async_trait::async_trait]
impl MigrationTrait for Migration {
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
let table = table_auto("users")
.col(pk_auto("id"))
... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/loco_starter/migration/src/main.rs | examples/loco_starter/migration/src/main.rs | use sea_orm_migration::prelude::*;
#[tokio::main]
async fn main() {
cli::run_cli(migration::Migrator).await;
}
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/loco_starter/migration/src/m20231103_114510_notes.rs | examples/loco_starter/migration/src/m20231103_114510_notes.rs | use sea_orm_migration::{prelude::*, schema::*};
#[derive(DeriveMigrationName)]
pub struct Migration;
#[async_trait::async_trait]
impl MigrationTrait for Migration {
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
manager
.create_table(
table_auto("notes")
... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/proxy_cloudflare_worker_example/src/orm.rs | examples/proxy_cloudflare_worker_example/src/orm.rs | use anyhow::{Context, Result, anyhow};
use std::{collections::BTreeMap, sync::Arc};
use wasm_bindgen::JsValue;
use sea_orm::{
ConnectionTrait, Database, DatabaseConnection, DbBackend, DbErr, ProxyDatabaseTrait,
ProxyExecResult, ProxyRow, RuntimeErr, Schema, Statement, Value, Values,
};
use worker::{Env, consol... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/proxy_cloudflare_worker_example/src/lib.rs | examples/proxy_cloudflare_worker_example/src/lib.rs | use anyhow::Result;
use axum::{body::Body, response::Response};
use tower_service::Service;
use worker::{Context, Env, HttpRequest, event};
pub(crate) mod entity;
pub(crate) mod orm;
pub(crate) mod route;
// https://developers.cloudflare.com/workers/languages/rust
#[event(fetch)]
async fn fetch(req: HttpRequest, env:... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/proxy_cloudflare_worker_example/src/entity.rs | examples/proxy_cloudflare_worker_example/src/entity.rs | use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel, Deserialize, Serialize)]
#[sea_orm(table_name = "posts")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i64,
pub title: String,
pub text: String,
}
#[derive(Copy, Clone,... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/proxy_cloudflare_worker_example/src/route.rs | examples/proxy_cloudflare_worker_example/src/route.rs | use anyhow::Result;
use std::sync::Arc;
use axum::{Router, extract::State, http::StatusCode, response::IntoResponse, routing::get};
use worker::{Env, console_error, console_log};
use sea_orm::{
ActiveModelTrait,
ActiveValue::{NotSet, Set},
EntityTrait,
};
#[derive(Clone)]
struct CFEnv {
pub env: Arc<... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/axum_example/src/main.rs | examples/axum_example/src/main.rs | fn main() {
axum_example_api::main();
}
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/axum_example/api/src/flash.rs | examples/axum_example/api/src/flash.rs | use axum::http::{HeaderMap, HeaderValue, StatusCode, header};
use serde::{Deserialize, Serialize, de::DeserializeOwned};
use tower_cookies::{Cookie, Cookies};
#[derive(Deserialize)]
struct ValuedMessage<T> {
#[serde(rename = "_")]
value: T,
}
#[derive(Serialize)]
struct ValuedMessageRef<'a, T> {
#[serde(r... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/axum_example/api/src/lib.rs | examples/axum_example/api/src/lib.rs | mod flash;
pub mod service;
use axum::{
Router,
extract::{Form, Path, Query, State},
http::StatusCode,
response::Html,
routing::{get, get_service, post},
};
use entity::post;
use flash::{PostResponse, get_flash_cookie, post_response};
use migration::{Migrator, MigratorTrait};
use sea_orm::{Database... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/axum_example/api/src/service/mutation.rs | examples/axum_example/api/src/service/mutation.rs | use ::entity::{post, post::Entity as Post};
use sea_orm::*;
pub struct Mutation;
impl Mutation {
pub async fn create_post(
db: &DbConn,
form_data: post::Model,
) -> Result<post::ActiveModel, DbErr> {
post::ActiveModel {
title: Set(form_data.title.to_owned()),
te... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/axum_example/api/src/service/mod.rs | examples/axum_example/api/src/service/mod.rs | mod mutation;
mod query;
pub use mutation::*;
pub use query::*;
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/axum_example/api/src/service/query.rs | examples/axum_example/api/src/service/query.rs | use ::entity::{post, post::Entity as Post};
use sea_orm::*;
pub struct Query;
impl Query {
pub async fn find_post_by_id(db: &DbConn, id: i32) -> Result<Option<post::Model>, DbErr> {
Post::find_by_id(id).one(db).await
}
/// If ok, returns (post models, num pages).
pub async fn find_posts_in_pa... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/axum_example/api/tests/crud_tests.rs | examples/axum_example/api/tests/crud_tests.rs | use axum_example_api::service::{Mutation, Query};
use entity::post;
use sea_orm::Database;
#[tokio::test]
async fn crud_tests() {
let db = &Database::connect("sqlite::memory:").await.unwrap();
db.get_schema_builder()
.register(post::Entity)
.apply(db)
.await
.unwrap();
{
... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/axum_example/entity/src/prelude.rs | examples/axum_example/entity/src/prelude.rs | //! `SeaORM` Entity, @generated by sea-orm-codegen 2.0.0-rc.16
pub use super::post::Entity as Post;
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/axum_example/entity/src/lib.rs | examples/axum_example/entity/src/lib.rs | //! `SeaORM` Entity, @generated by sea-orm-codegen 2.0.0-rc.16
pub mod prelude;
pub mod post;
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/axum_example/entity/src/post.rs | examples/axum_example/entity/src/post.rs | //! `SeaORM` Entity, @generated by sea-orm-codegen 2.0.0-rc.16
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[sea_orm::model]
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel, Serialize, Deserialize)]
#[sea_orm(table_name = "post")]
pub struct Model {
#[sea_orm(primary_key)]
#[... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/axum_example/migration/src/lib.rs | examples/axum_example/migration/src/lib.rs | pub use sea_orm_migration::prelude::*;
mod m20220120_000001_create_post_table;
mod m20220120_000002_seed_posts;
pub struct Migrator;
#[async_trait::async_trait]
impl MigratorTrait for Migrator {
fn migrations() -> Vec<Box<dyn MigrationTrait>> {
vec![
Box::new(m20220120_000001_create_post_tabl... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/axum_example/migration/src/m20220120_000002_seed_posts.rs | examples/axum_example/migration/src/m20220120_000002_seed_posts.rs | use entity::post;
use sea_orm::{ActiveModelTrait, ColumnTrait, EntityTrait, QueryFilter, Set};
use sea_orm_migration::prelude::*;
#[derive(DeriveMigrationName)]
pub struct Migration;
#[async_trait::async_trait]
impl MigrationTrait for Migration {
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/axum_example/migration/src/m20220120_000001_create_post_table.rs | examples/axum_example/migration/src/m20220120_000001_create_post_table.rs | use sea_orm_migration::{prelude::*, schema::*};
#[derive(DeriveMigrationName)]
pub struct Migration;
#[async_trait::async_trait]
impl MigrationTrait for Migration {
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
manager
.create_table(
Table::create()
... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.