public override IEnumerable <IAnnotation> For(IIndex index) { var indexAnnotations = base.For(index); var nullFilteredIndexAnnotation = index.FindAnnotation(SpannerAnnotationNames.IsNullFilteredIndex); if (nullFilteredIndexAnnotation != null) { indexAnnotations = indexAnnotations.Concat(new[] { nullFilteredIndexAnnotation }); } var storingIndexAnnotation = index.FindAnnotation(SpannerAnnotationNames.Storing); if (storingIndexAnnotation != null) { indexAnnotations = indexAnnotations.Concat(new[] { storingIndexAnnotation }); } return(indexAnnotations); }
/// <summary> /// Returns a value indicating whether the index is clustered. /// </summary> /// <param name="index"> The index. </param> /// <param name="storeObject"> The identifier of the store object. </param> /// <returns> <see langword="true" /> if the index is clustered. </returns> public static bool?IsClustered([NotNull] this IIndex index, StoreObjectIdentifier storeObject) { var annotation = index.FindAnnotation(SqlServerAnnotationNames.Clustered); if (annotation != null) { return((bool?)annotation.Value); } return(GetDefaultIsClustered(index, storeObject)); }
/// <summary> /// Returns the index filter expression. /// </summary> /// <param name="index"> The index. </param> /// <param name="tableName"> The table name. </param> /// <param name="schema"> The schema. </param> /// <returns> The index filter expression. </returns> public static string GetFilter([NotNull] this IIndex index, [NotNull] string tableName, [CanBeNull] string schema) { var annotation = index.FindAnnotation(RelationalAnnotationNames.Filter); if (annotation != null) { return((string)annotation.Value); } var sharedTableRootIndex = index.FindSharedTableRootIndex(tableName, schema); return(sharedTableRootIndex?.GetFilter(tableName, schema)); }
/// <summary> /// Returns the index filter expression. /// </summary> /// <param name="index"> The index. </param> /// <param name="storeObject"> The identifier of the containing store object. </param> /// <returns> The index filter expression. </returns> public static string GetFilter([NotNull] this IIndex index, StoreObjectIdentifier storeObject) { var annotation = index.FindAnnotation(RelationalAnnotationNames.Filter); if (annotation != null) { return((string)annotation.Value); } var sharedTableRootIndex = index.FindSharedObjectRootIndex(storeObject); return(sharedTableRootIndex?.GetFilter(storeObject)); }
/// <summary> /// Returns a value indicating whether the index is clustered. /// </summary> /// <param name="index"> The index. </param> /// <param name="tableName"> The table name. </param> /// <param name="schema"> The schema. </param> /// <returns> <see langword="true" /> if the index is clustered. </returns> public static bool?IsClustered( [NotNull] this IIndex index, [NotNull] string tableName, [CanBeNull] string schema) { var annotation = index.FindAnnotation(SqlServerAnnotationNames.Clustered); if (annotation != null) { return((bool?)annotation.Value); } return(GetDefaultIsClustered(index, tableName, schema)); }
/// <summary> /// Returns the index filter expression. /// </summary> /// <param name="index"> The index. </param> /// <returns> The index filter expression. </returns> public static string GetFilter([NotNull] this IIndex index) { var annotation = index.FindAnnotation(RelationalAnnotationNames.Filter); return(annotation != null ? (string)annotation.Value : null); }