Skip to main content

Crate scythe_codegen

Crate scythe_codegen 

Source

Re-exports§

pub use backend_trait::CodegenBackend;
pub use backend_trait::RbsEnumInfo;
pub use backend_trait::RbsGenerationContext;
pub use backend_trait::RbsQueryInfo;
pub use backend_trait::ResolvedColumn;
pub use backend_trait::ResolvedParam;
pub use backends::get_backend;
pub use overrides::TypeOverride;

Modules§

backend_options
backend_trait
backends
overrides
provenance
The provenance header line every generated file carries, and the exact byte ordering it sits in.
resolve
validation

Structs§

GeneratedCode
NestedStructDef
One rendered nested-aggregate struct definition, paired with the name it declares so file writers can deduplicate.

Functions§

degrade_unsupported_nested_structs
Degradation pass for nested-aggregate columns (json_agg(o.*), row_to_json(u.*)). Must run before resolve::resolve_columns – every caller that resolves AnalyzedColumns into a backend’s types needs this, not just generate_with_backend_and_overrides: scythe-cli’s RBS signature generation (generate_rbs_if_supported) calls resolve::resolve_columns directly on a second, independent path, so it must run this pass too or it silently bypasses the byte-identity guarantee for any backend that hasn’t opted in.
generate
Backward-compatible: generate code using the default sqlx backend.
generate_from_catalog
Stub for catalog-level codegen. Returns default for now.
generate_single_enum_def
Backward-compatible: generate a single enum definition (sqlx backend). Uses the manifest directly for backward compatibility with existing callers.
generate_single_enum_def_with_backend
Generate a single enum definition using a specific backend.
generate_with_backend
Generate code using a specific backend.
generate_with_backend_and_overrides
Generate code using a specific backend with type overrides.
get_manifest_for_backend
Get the manifest for a backend. Defaults to PostgreSQL engine.
load_or_default_manifest
Backward-compatible: load the default sqlx manifest.
nested_type_is_emitted
Whether sql_name is reachable from a nested-aggregate struct the backend actually emitted a definition for.
singularize
Simple singularization: remove trailing ‘s’.