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/examples/axum_example/migration/src/main.rs | examples/axum_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/tonic_example/src/client.rs | examples/tonic_example/src/client.rs | use tonic::Request;
use tonic::transport::Endpoint;
use tonic_example_api::post_mod::{PostPerPage, blogpost_client::BlogpostClient};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let addr = Endpoint::from_static("http://0.0.0.0:50051");
/*
Client code is not implemented in co... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/tonic_example/src/server.rs | examples/tonic_example/src/server.rs | fn main() {
tonic_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/tonic_example/api/build.rs | examples/tonic_example/api/build.rs | fn main() {
let proto_file = "./proto/post.proto";
tonic_build::configure()
.build_server(true)
.compile(&[proto_file], &["."])
.unwrap_or_else(|e| panic!("protobuf compile error: {}", e));
println!("cargo:rerun-if-changed={}", proto_file);
}
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/tonic_example/api/src/lib.rs | examples/tonic_example/api/src/lib.rs | pub mod service;
use tonic::transport::Server;
use tonic::{Request, Response, Status};
use entity::post;
use migration::{Migrator, MigratorTrait};
use sea_orm::{Database, DatabaseConnection};
use service::{Mutation, Query};
use std::env;
pub mod post_mod {
tonic::include_proto!("post");
}
use post_mod::{
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/tonic_example/api/src/service/mutation.rs | examples/tonic_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/tonic_example/api/src/service/mod.rs | examples/tonic_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/tonic_example/api/src/service/query.rs | examples/tonic_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/tonic_example/api/tests/crud_tests.rs | examples/tonic_example/api/tests/crud_tests.rs | use entity::post;
use sea_orm::Database;
use tonic_example_api::service::{Mutation, Query};
#[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/tonic_example/entity/src/prelude.rs | examples/tonic_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/tonic_example/entity/src/lib.rs | examples/tonic_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/tonic_example/entity/src/post.rs | examples/tonic_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/tonic_example/migration/src/lib.rs | examples/tonic_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/tonic_example/migration/src/m20220120_000002_seed_posts.rs | examples/tonic_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/tonic_example/migration/src/m20220120_000001_create_post_table.rs | examples/tonic_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/tonic_example/migration/src/main.rs | examples/tonic_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/react_admin/backend/src/app.rs | examples/react_admin/backend/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/react_admin/backend/src/lib.rs | examples/react_admin/backend/src/lib.rs | pub mod app;
pub mod controllers;
pub mod graphql;
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/react_admin/backend/src/tasks/seed.rs | examples/react_admin/backend/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/react_admin/backend/src/tasks/mod.rs | examples/react_admin/backend/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/react_admin/backend/src/workers/downloader.rs | examples/react_admin/backend/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/react_admin/backend/src/workers/mod.rs | examples/react_admin/backend/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/react_admin/backend/src/graphql/query_root.rs | examples/react_admin/backend/src/graphql/query_root.rs | use async_graphql::dynamic::*;
use sea_orm::DatabaseConnection;
use seaography::{Builder, BuilderContext};
lazy_static::lazy_static! { static ref CONTEXT: BuilderContext = BuilderContext::default(); }
pub fn schema(
database: DatabaseConnection,
depth: usize,
complexity: usize,
) -> Result<Schema, SchemaE... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/react_admin/backend/src/graphql/mod.rs | examples/react_admin/backend/src/graphql/mod.rs | 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/react_admin/backend/src/controllers/user.rs | examples/react_admin/backend/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/react_admin/backend/src/controllers/auth.rs | examples/react_admin/backend/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/react_admin/backend/src/controllers/mod.rs | examples/react_admin/backend/src/controllers/mod.rs | pub mod auth;
pub mod files;
pub mod graphql;
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/react_admin/backend/src/controllers/notes.rs | examples/react_admin/backend/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/react_admin/backend/src/controllers/files.rs | examples/react_admin/backend/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/react_admin/backend/src/controllers/graphql.rs | examples/react_admin/backend/src/controllers/graphql.rs | use async_graphql::http::{GraphQLPlaygroundConfig, playground_source};
use axum::{body::Body, extract::Request};
use loco_rs::prelude::*;
use tower_service::Service;
use crate::graphql::query_root;
// GraphQL playground UI
async fn graphql_playground() -> Result<Response> {
// The `GraphQLPlaygroundConfig` take 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/react_admin/backend/src/models/users.rs | examples/react_admin/backend/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/react_admin/backend/src/models/mod.rs | examples/react_admin/backend/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/react_admin/backend/src/models/notes.rs | examples/react_admin/backend/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/react_admin/backend/src/models/files.rs | examples/react_admin/backend/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/react_admin/backend/src/models/_entities/prelude.rs | examples/react_admin/backend/src/models/_entities/prelude.rs | //! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0-rc.5
pub use super::{files::Entity as Files, 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/react_admin/backend/src/models/_entities/users.rs | examples/react_admin/backend/src/models/_entities/users.rs | //! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0-rc.5
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: Da... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/react_admin/backend/src/models/_entities/mod.rs | examples/react_admin/backend/src/models/_entities/mod.rs | //! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0-rc.5
pub mod prelude;
pub mod files;
pub mod notes;
pub mod users;
seaography::register_entity_modules!([files, notes, 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/react_admin/backend/src/models/_entities/notes.rs | examples/react_admin/backend/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/react_admin/backend/src/models/_entities/files.rs | examples/react_admin/backend/src/models/_entities/files.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 = "files")]
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/react_admin/backend/src/views/user.rs | examples/react_admin/backend/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/react_admin/backend/src/views/auth.rs | examples/react_admin/backend/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/react_admin/backend/src/views/mod.rs | examples/react_admin/backend/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/react_admin/backend/src/bin/main.rs | examples/react_admin/backend/src/bin/main.rs | use loco_rs::cli;
use loco_seaography::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/react_admin/backend/src/mailers/auth.rs | examples/react_admin/backend/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/react_admin/backend/src/mailers/mod.rs | examples/react_admin/backend/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/react_admin/backend/examples/playground.rs | examples/react_admin/backend/examples/playground.rs | use eyre::Context;
#[allow(unused_imports)]
use loco_rs::{cli::playground, prelude::*};
use loco_seaography::app::App;
#[tokio::main]
async fn main() -> eyre::Result<()> {
let _ctx = playground::<App>().await.context("playground")?;
// let active_model: articles::ActiveModel = ActiveModel {
// title: ... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/react_admin/backend/migration/src/m20240520_173001_files.rs | examples/react_admin/backend/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/react_admin/backend/migration/src/lib.rs | examples/react_admin/backend/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/react_admin/backend/migration/src/m20220101_000001_users.rs | examples/react_admin/backend/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/react_admin/backend/migration/src/main.rs | examples/react_admin/backend/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/react_admin/backend/migration/src/m20231103_114510_notes.rs | examples/react_admin/backend/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_gluesql_example/src/main.rs | examples/proxy_gluesql_example/src/main.rs | //! Proxy connection example.
#![deny(missing_docs)]
mod entity;
use std::{
collections::BTreeMap,
sync::{Arc, Mutex},
};
use gluesql::{memory_storage::MemoryStorage, prelude::Glue};
use sea_orm::{
ActiveValue::Set, Database, DbBackend, DbErr, EntityTrait, ProxyDatabaseTrait, ProxyExecResult,
ProxyR... | 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_gluesql_example/src/entity/mod.rs | examples/proxy_gluesql_example/src/entity/mod.rs | 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/proxy_gluesql_example/src/entity/post.rs | examples/proxy_gluesql_example/src/entity/post.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/basic/src/mutation.rs | examples/basic/src/mutation.rs | use super::*;
use sea_orm::{DbConn, entity::*, error::*};
pub async fn all_about_mutation(db: &DbConn) -> Result<(), DbErr> {
insert_and_update(db).await?;
println!("===== =====\n");
save_active_model(db).await?;
println!("===== =====\n");
save_custom_active_model(db).await?;
Ok(())
}
pub... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/basic/src/query.rs | examples/basic/src/query.rs | use super::*;
use sea_orm::{DbConn, FromQueryResult, entity::*, error::*, query::*};
pub async fn all_about_query(db: &DbConn) -> Result<(), DbErr> {
find_all(db).await?;
println!("===== =====\n");
find_one(db).await?;
println!("===== =====\n");
find_one_to_one(db).await?;
println!("===== ... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/basic/src/main.rs | examples/basic/src/main.rs | //! Basic sea-orm example.
#![deny(missing_docs)]
use sea_orm::Database;
mod entity;
mod mutation;
mod query;
use entity::*;
use mutation::*;
use query::*;
#[tokio::main]
async fn main() {
let db = Database::connect(
std::env::var("DATABASE_URL")
.unwrap_or_else(|_| "mysql://sea:sea@localho... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/basic/src/entity/cake_filling.rs | examples/basic/src/entity/cake_filling.rs | //! SeaORM Entity. Generated by sea-orm-codegen 0.1.0
use sea_orm::entity::prelude::*;
#[sea_orm::model]
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)]
#[sea_orm(table_name = "cake_filling")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub cake_id: i32,
#[sea_orm(primary_... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/basic/src/entity/cake.rs | examples/basic/src/entity/cake.rs | //! SeaORM Entity. Generated by sea-orm-codegen 0.1.0
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,
#[sea_orm(column_type = "Text", nullable)]
pub name... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/basic/src/entity/sea_orm_active_enums.rs | examples/basic/src/entity/sea_orm_active_enums.rs | //! SeaORM's active enums.
use sea_orm::entity::prelude::*;
/// Tea active enum
#[derive(Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum)]
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "tea")]
pub enum Tea {
/// EverydayTea variant
#[sea_orm(string_value = "EverydayTea")]
EverydayTea... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/basic/src/entity/filling.rs | examples/basic/src/entity/filling.rs | //! SeaORM Entity. Generated by sea-orm-codegen 0.1.0
use sea_orm::entity::prelude::*;
#[sea_orm::model]
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)]
#[sea_orm(table_name = "filling")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
pub name: String,
#[sea_orm(has_many, via = "cak... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/basic/src/entity/fruit.rs | examples/basic/src/entity/fruit.rs | //! SeaORM Entity. Generated by sea-orm-codegen 0.1.0
use sea_orm::entity::prelude::*;
#[sea_orm::model]
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)]
#[sea_orm(table_name = "fruit")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
pub name: String,
pub cake_id: Option<i32>,
#[... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/examples/basic/src/entity/mod.rs | examples/basic/src/entity/mod.rs | pub mod cake;
pub mod cake_filling;
pub mod filling;
pub mod fruit;
pub mod sea_orm_active_enums;
pub use cake::Entity as Cake;
pub use cake_filling::Entity as CakeFilling;
pub use filling::Entity as Filling;
pub use fruit::Entity as Fruit;
| 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_seaography/src/app.rs | examples/loco_seaography/src/app.rs | use std::path::Path;
use async_trait::async_trait;
use loco_rs::{
Result,
app::{AppContext, Hooks, Initializer},
bgworker::{BackgroundWorker, Queue},
boot::{BootResult, StartMode, create_app},
config::Config,
controller::AppRoutes,
db::{self, truncate_table},
environment::Environment,
... | 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_seaography/src/lib.rs | examples/loco_seaography/src/lib.rs | pub mod app;
pub mod controllers;
pub mod graphql;
pub mod initializers;
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_seaography/src/initializers/mod.rs | examples/loco_seaography/src/initializers/mod.rs | pub mod graphql;
| 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_seaography/src/initializers/graphql.rs | examples/loco_seaography/src/initializers/graphql.rs | use crate::graphql::query_root;
use async_trait::async_trait;
use axum::Router as AxumRouter;
use loco_rs::prelude::*;
// Maximum depth of the constructed query
const DEPTH: Option<usize> = None;
// Maximum complexity of the constructed query
const COMPLEXITY: Option<usize> = None;
pub struct GraphQLInitializer;
#[a... | 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_seaography/src/tasks/seed.rs | examples/loco_seaography/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_seaography/src/tasks/mod.rs | examples/loco_seaography/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_seaography/src/workers/downloader.rs | examples/loco_seaography/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_seaography/src/workers/mod.rs | examples/loco_seaography/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_seaography/src/graphql/query_root.rs | examples/loco_seaography/src/graphql/query_root.rs | use async_graphql::dynamic::*;
use sea_orm::DatabaseConnection;
use seaography::{Builder, BuilderContext, async_graphql};
lazy_static::lazy_static! { static ref CONTEXT: BuilderContext = BuilderContext::default(); }
pub fn schema(
database: DatabaseConnection,
depth: Option<usize>,
complexity: Option<usiz... | 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_seaography/src/graphql/mod.rs | examples/loco_seaography/src/graphql/mod.rs | 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/loco_seaography/src/controllers/user.rs | examples/loco_seaography/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_seaography/src/controllers/auth.rs | examples/loco_seaography/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_seaography/src/controllers/mod.rs | examples/loco_seaography/src/controllers/mod.rs | pub mod auth;
pub mod files;
pub mod graphql;
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_seaography/src/controllers/notes.rs | examples/loco_seaography/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_seaography/src/controllers/files.rs | examples/loco_seaography/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_seaography/src/controllers/graphql.rs | examples/loco_seaography/src/controllers/graphql.rs | use async_graphql::{
dynamic::Schema,
http::{GraphQLPlaygroundConfig, playground_source},
};
use async_graphql_axum::GraphQLRequest;
use loco_rs::prelude::*;
use seaography::async_graphql;
// GraphQL playground UI
async fn graphql_playground() -> Result<Response> {
// The `GraphQLPlaygroundConfig` take one... | 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_seaography/src/models/users.rs | examples/loco_seaography/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_seaography/src/models/mod.rs | examples/loco_seaography/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_seaography/src/models/notes.rs | examples/loco_seaography/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_seaography/src/models/files.rs | examples/loco_seaography/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_seaography/src/models/_entities/prelude.rs | examples/loco_seaography/src/models/_entities/prelude.rs | //! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0-rc.5
pub use super::{files::Entity as Files, 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_seaography/src/models/_entities/users.rs | examples/loco_seaography/src/models/_entities/users.rs | //! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0-rc.5
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: Da... | 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_seaography/src/models/_entities/mod.rs | examples/loco_seaography/src/models/_entities/mod.rs | //! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0-rc.5
pub mod prelude;
pub mod files;
pub mod notes;
pub mod users;
seaography::register_entity_modules!([files, notes, 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_seaography/src/models/_entities/notes.rs | examples/loco_seaography/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_seaography/src/models/_entities/files.rs | examples/loco_seaography/src/models/_entities/files.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 = "files")]
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_seaography/src/views/user.rs | examples/loco_seaography/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_seaography/src/views/auth.rs | examples/loco_seaography/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_seaography/src/views/mod.rs | examples/loco_seaography/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_seaography/src/bin/main.rs | examples/loco_seaography/src/bin/main.rs | use loco_rs::cli;
use loco_seaography::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_seaography/src/mailers/auth.rs | examples/loco_seaography/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_seaography/src/mailers/mod.rs | examples/loco_seaography/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_seaography/migration/src/m20240520_173001_files.rs | examples/loco_seaography/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_seaography/migration/src/lib.rs | examples/loco_seaography/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_seaography/migration/src/m20220101_000001_users.rs | examples/loco_seaography/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_seaography/migration/src/main.rs | examples/loco_seaography/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_seaography/migration/src/m20231103_114510_notes.rs | examples/loco_seaography/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/poem_example/src/main.rs | examples/poem_example/src/main.rs | fn main() {
poem_example_api::main();
}
| 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.