Skip to main content

fraiseql_storage/
lib.rs

1//! Object storage abstraction layer for FraiseQL.
2//!
3//! Provides enum-based dispatch to local filesystem, AWS S3, Google Cloud Storage,
4//! Azure Blob Storage, and S3-compatible European providers (Hetzner, Scaleway, OVH, Exoscale,
5//! Backblaze, R2).
6//!
7//! # Architecture
8//!
9//! The storage system is organized into layers:
10//!
11//! - **Backend**: Enum-based dispatch over storage providers with native async methods
12//! - **Config**: Bucket configuration with size limits, MIME type restrictions
13//! - **Metadata**: SQL repository for object metadata (Postgres-only)
14//! - **RLS**: Row-level security enforcement for access control
15//! - **Routes**: HTTP handlers for `PUT`, `GET`, `DELETE`, `LIST`
16
17#![warn(missing_docs)]
18// Wave 9 (Q4): pilot crate #3 for the workspace `clippy::indexing_slicing`
19// rollout. All library code is panic-free w.r.t. slice/vec indexing; test
20// modules carry per-file `#![allow]` + `// Reason:`.
21#![deny(clippy::indexing_slicing)]
22
23pub mod backend;
24pub mod config;
25pub mod graphql;
26pub mod metadata;
27pub mod migrations;
28pub mod rls;
29pub mod routes;
30pub mod service;
31pub mod transforms;
32
33// Re-exports for convenience
34#[cfg(feature = "azure-blob")]
35pub use backend::AzureBackend;
36#[cfg(feature = "gcs")]
37pub use backend::GcsBackend;
38#[cfg(feature = "aws-s3")]
39pub use backend::PresignCapable;
40#[cfg(feature = "aws-s3")]
41pub use backend::S3Backend;
42pub use backend::{
43    LocalBackend, PresignedUrl, StorageBackend, create_backend,
44    types::{ListResult, ObjectInfo, ObjectMetadata, PutResult, StorageObject},
45    validate_key,
46};
47pub use config::{BucketAccess, BucketConfig, StorageConfig};
48pub use graphql::{StorageSchemaEntries, StorageSchemaTypes};
49pub use metadata::{NewStorageObject, StorageMetadataRepo, StorageMetadataRow};
50pub use rls::StorageRlsEvaluator;
51pub use routes::{StorageState, StorageUser, storage_router};
52pub use service::BucketService;
53#[cfg(feature = "transforms")]
54pub use transforms::{
55    ImageTransformer, OutputFormat, TransformCache, TransformOutput, TransformParams,
56};