Skip to main content

Crate fraiseql_storage

Crate fraiseql_storage 

Source
Expand description

Object storage abstraction layer for FraiseQL.

Provides enum-based dispatch to local filesystem, AWS S3, Google Cloud Storage, Azure Blob Storage, and S3-compatible European providers (Hetzner, Scaleway, OVH, Exoscale, Backblaze, R2).

§Architecture

The storage system is organized into layers:

  • Backend: Enum-based dispatch over storage providers with native async methods
  • Config: Bucket configuration with size limits, MIME type restrictions
  • Metadata: SQL repository for object metadata (Postgres-only)
  • RLS: Row-level security enforcement for access control
  • Routes: HTTP handlers for PUT, GET, DELETE, LIST

Re-exports§

pub use backend::LocalBackend;
pub use backend::PresignedUrl;
pub use backend::StorageBackend;
pub use backend::create_backend;
pub use backend::types::ListResult;
pub use backend::types::ObjectInfo;
pub use backend::types::ObjectMetadata;
pub use backend::types::PutResult;
pub use backend::types::StorageObject;
pub use backend::validate_key;
pub use config::BucketAccess;
pub use config::BucketConfig;
pub use config::StorageConfig;
pub use graphql::StorageSchemaEntries;
pub use graphql::StorageSchemaTypes;
pub use metadata::NewStorageObject;
pub use metadata::StorageMetadataRepo;
pub use metadata::StorageMetadataRow;
pub use rls::StorageRlsEvaluator;
pub use routes::StorageState;
pub use routes::StorageUser;
pub use routes::storage_router;
pub use service::BucketService;

Modules§

backend
Object storage backends for file upload and download.
config
Bucket configuration and validation.
graphql
GraphQL schema type generation for storage operations.
metadata
Object metadata storage and retrieval.
migrations
Database migrations for storage metadata tables.
rls
Row-level security enforcement for storage operations.
routes
HTTP route handlers for storage operations.
service
Policy-enforcing wrapper around storage backends.
transforms
Image transformation and caching module.