Exemple #1
0
    /// <summary>
    /// Sets the compression method for the column.
    /// </summary>
    /// <remarks>This feature was introduced in PostgreSQL 14.</remarks>
    /// <param name="propertyBuilder">The builder for the property being configured.</param>
    /// <param name="compressionMethod">The compression method.</param>
    /// <param name="fromDataAnnotation">Indicates whether the configuration was specified using a data annotation.</param>
    /// <returns>A builder to further configure the property.</returns>
    public static IConventionPropertyBuilder?UseCompressionMethod(
        this IConventionPropertyBuilder propertyBuilder,
        string?compressionMethod,
        bool fromDataAnnotation = false)
    {
        if (propertyBuilder.CanSetCompressionMethod(compressionMethod, fromDataAnnotation))
        {
            propertyBuilder.Metadata.SetCompressionMethod(compressionMethod, fromDataAnnotation);

            return(propertyBuilder);
        }

        return(null);
    }