namespace NpgsqlRest;
///
/// Base interface for endpoint sources. Provides the minimal contract needed
/// to yield routines into the NpgsqlRest pipeline.
///
public interface IEndpointSource
{
///
/// Comments mode for the current source.
///
CommentsMode? CommentsMode { get; set; }
///
/// When true, composite type columns in the response are serialized as nested JSON objects.
/// For example, a column "req" of type "my_request(id int, name text)" becomes {"req": {"id": 1, "name": "test"}}
/// instead of the default flat structure {"id": 1, "name": "test"}.
/// Default is false.
///
bool NestedJsonForCompositeTypes { get; set; }
///
/// Yield all routines with the formatters from the current source.
///
/// Service provider
///
///
IEnumerable<(Routine, IRoutineSourceParameterFormatter)> Read(IServiceProvider? serviceProvider, RetryStrategy? retryStrategy);
}
///
/// Extended endpoint source interface for database catalog-based sources (functions, procedures, tables, views).
/// Adds query filtering properties for schema/name patterns.
///
public interface IRoutineSource : IEndpointSource
{
///
/// SQL Query that returns data source.
/// When it doesn't contain any blanks, it is interpreted as a function name.
/// Set to NULL to use default source query.
///
string? Query { get; set; }
///
/// Query parameter
///
string? SchemaSimilarTo { get; set; }
///
/// Query parameter
///
string? SchemaNotSimilarTo { get; set; }
///
/// Query parameter
///
string[]? IncludeSchemas { get; set; }
///
/// Query parameter
///
string[]? ExcludeSchemas { get; set; }
///
/// Query parameter
///
string? NameSimilarTo { get; set; }
///
/// Query parameter
///
string? NameNotSimilarTo { get; set; }
///
/// Query parameter
///
string[]? IncludeNames { get; set; }
///
/// Query parameter
///
string[]? ExcludeNames { get; set; }
}