@@ -2834,48 +2834,6 @@ END;
2834
2834
$$ LANGUAGE plpgsql;
2835
2835
2836
2836
2837
- CREATE OR REPLACE FUNCTION test_get_valid_target_type_strings () RETURNS SETOF TEXT AS $$
2838
- DECLARE
2839
- target_type_strings jsonb;
2840
- BEGIN
2841
- target_type_strings = msar .get_valid_target_type_strings (' text' );
2842
- RETURN NEXT is(jsonb_array_length(target_type_strings), 28 );
2843
- RETURN NEXT ok(
2844
- target_type_strings @> jsonb_build_array(
2845
- ' real' , ' double precision' , ' mathesar_types.email' , ' smallint' , ' boolean' , ' bigint' ,
2846
- ' integer' , ' interval' , ' time without time zone' , ' time with time zone' ,
2847
- ' timestamp with time zone' , ' timestamp without time zone' , ' date' ,
2848
- ' mathesar_types.mathesar_money' , ' money' , ' mathesar_types.multicurrency_money' ,
2849
- ' character varying' , ' character' , ' "char"' , ' text' , ' name' , ' mathesar_types.uri' , ' numeric' ,
2850
- ' jsonb' , ' mathesar_types.mathesar_json_array' , ' mathesar_types.mathesar_json_object' , ' json' , ' uuid'
2851
- ),
2852
- ' containment plus length checks order-independent equality'
2853
- );
2854
- target_type_strings = msar .get_valid_target_type_strings (' text' ::regtype::oid );
2855
- RETURN NEXT is(jsonb_array_length(target_type_strings), 28 );
2856
- RETURN NEXT ok(
2857
- target_type_strings @> jsonb_build_array(
2858
- ' real' , ' double precision' , ' mathesar_types.email' , ' smallint' , ' boolean' , ' bigint' ,
2859
- ' integer' , ' interval' , ' time without time zone' , ' time with time zone' ,
2860
- ' timestamp with time zone' , ' timestamp without time zone' , ' date' ,
2861
- ' mathesar_types.mathesar_money' , ' money' , ' mathesar_types.multicurrency_money' ,
2862
- ' character varying' , ' character' , ' "char"' , ' text' , ' name' , ' mathesar_types.uri' , ' numeric' ,
2863
- ' jsonb' , ' mathesar_types.mathesar_json_array' , ' mathesar_types.mathesar_json_object' , ' json' , ' uuid'
2864
- ),
2865
- ' containment plus length checks order-independent equality'
2866
- );
2867
- target_type_strings = msar .get_valid_target_type_strings (' interval' );
2868
- RETURN NEXT is(jsonb_array_length(target_type_strings), 6 );
2869
- RETURN NEXT ok(
2870
- target_type_strings @> jsonb_build_array(
2871
- ' interval' , ' character varying' , ' character' , ' "char"' , ' text' , ' name'
2872
- ),
2873
- ' containment plus length checks order-independent equality'
2874
- );
2875
- END;
2876
- $$ LANGUAGE plpgsql;
2877
-
2878
-
2879
2837
CREATE OR REPLACE FUNCTION test_has_dependents () RETURNS SETOF TEXT AS $$
2880
2838
BEGIN
2881
2839
PERFORM __setup_extract_fkey_cols();
@@ -2907,8 +2865,8 @@ $$ LANGUAGE plpgsql;
2907
2865
2908
2866
2909
2867
CREATE OR REPLACE FUNCTION test_get_column_info () RETURNS SETOF TEXT AS $$/*
2910
- This test doesn't inspect the contents of the current_role_priv or valid_target_types arrays , since
2911
- the functions that generate those contents are tested elsewhere. We just make sure the arrays exist,
2868
+ This test doesn't inspect the contents of the current_role_priv array , since
2869
+ the functions that generate those contents are tested elsewhere. We just make sure the array exist,
2912
2870
and are non-empty. All other contents of the returned jsonb are tested.
2913
2871
*/
2914
2872
DECLARE
@@ -2920,7 +2878,7 @@ BEGIN
2920
2878
2921
2879
-- Column 1
2922
2880
RETURN NEXT is(
2923
- (col_info - > 0 ) - ARRAY[' current_role_priv' , ' valid_target_types ' ],
2881
+ (col_info - > 0 ) - ARRAY[' current_role_priv' ],
2924
2882
$j${
2925
2883
" id" : 1 , " name" : " id" , " type" : " integer" ,
2926
2884
" default" : {" value" : " identity" , " is_dynamic" : true},
@@ -2929,89 +2887,83 @@ BEGIN
2929
2887
}$j$
2930
2888
);
2931
2889
RETURN NEXT ok(
2932
- jsonb_array_length(col_info - > 0 - > ' current_role_priv' ) > 0
2933
- AND jsonb_array_length(col_info - > 0 - > ' valid_target_types' ) > 0 ,
2934
- ' current_role_priv and valid_target_types should be non-empty jsonb arrays'
2890
+ jsonb_array_length(col_info - > 0 - > ' current_role_priv' ) > 0 ,
2891
+ ' current_role_priv should be a non-empty jsonb array'
2935
2892
);
2936
2893
2937
2894
-- Column 2
2938
2895
RETURN NEXT is(
2939
- (col_info - > 1 ) - ARRAY[' current_role_priv' , ' valid_target_types ' ],
2896
+ (col_info - > 1 ) - ARRAY[' current_role_priv' ],
2940
2897
$j${
2941
2898
" id" : 2 , " name" : " num_plain" , " type" : " numeric" , " default" : null , " nullable" : false,
2942
2899
" description" : null , " primary_key" : false, " type_options" : {" scale" : null , " precision" : null },
2943
2900
" has_dependents" : false
2944
2901
}$j$
2945
2902
);
2946
2903
RETURN NEXT ok(
2947
- jsonb_array_length(col_info - > 1 - > ' current_role_priv' ) > 0
2948
- AND jsonb_array_length(col_info - > 1 - > ' valid_target_types' ) > 0 ,
2949
- ' current_role_priv and valid_target_types should be non-empty jsonb arrays'
2904
+ jsonb_array_length(col_info - > 1 - > ' current_role_priv' ) > 0 ,
2905
+ ' current_role_priv should be a non-empty jsonb array'
2950
2906
);
2951
2907
2952
2908
-- Column 3
2953
2909
RETURN NEXT is(
2954
- (col_info - > 2 ) - ARRAY[' current_role_priv' , ' valid_target_types ' ],
2910
+ (col_info - > 2 ) - ARRAY[' current_role_priv' ],
2955
2911
$j${
2956
2912
" id" : 3 , " name" : " var_128" , " type" : " character varying" , " default" : null , " nullable" : true,
2957
2913
" description" : null , " primary_key" : false, " type_options" : {" length" : 128 },
2958
2914
" has_dependents" : false
2959
2915
}$j$
2960
2916
);
2961
2917
RETURN NEXT ok(
2962
- jsonb_array_length(col_info - > 2 - > ' current_role_priv' ) > 0
2963
- AND jsonb_array_length(col_info - > 2 - > ' valid_target_types' ) > 0 ,
2964
- ' current_role_priv and valid_target_types should be non-empty jsonb arrays'
2918
+ jsonb_array_length(col_info - > 2 - > ' current_role_priv' ) > 0 ,
2919
+ ' current_role_priv should be a non-empty jsonb array'
2965
2920
);
2966
2921
2967
2922
-- Column 4
2968
2923
RETURN NEXT is(
2969
- (col_info - > 3 ) - ARRAY[' current_role_priv' , ' valid_target_types ' ],
2924
+ (col_info - > 3 ) - ARRAY[' current_role_priv' ],
2970
2925
$j${
2971
2926
" id" : 4 , " name" : " txt" , " type" : " text" , " default" : {" value" : " abc" , " is_dynamic" : false},
2972
2927
" nullable" : true, " description" : " A super comment ;" , " primary_key" : false,
2973
2928
" type_options" : null , " has_dependents" : false
2974
2929
}$j$
2975
2930
);
2976
2931
RETURN NEXT ok(
2977
- jsonb_array_length(col_info - > 3 - > ' current_role_priv' ) > 0
2978
- AND jsonb_array_length(col_info - > 3 - > ' valid_target_types' ) > 0 ,
2979
- ' current_role_priv and valid_target_types should be non-empty jsonb arrays'
2932
+ jsonb_array_length(col_info - > 3 - > ' current_role_priv' ) > 0 ,
2933
+ ' current_role_priv should be a non-empty jsonb array'
2980
2934
);
2981
2935
2982
2936
-- Column 5
2983
2937
RETURN NEXT is(
2984
- (col_info - > 4 ) - ARRAY[' current_role_priv' , ' valid_target_types ' ],
2938
+ (col_info - > 4 ) - ARRAY[' current_role_priv' ],
2985
2939
$j${
2986
2940
" id" : 5 , " name" : " tst" , " type" : " timestamp without time zone" ,
2987
2941
" default" : {" value" : " now()" , " is_dynamic" : true}, " nullable" : true, " description" : null ,
2988
2942
" primary_key" : false, " type_options" : {" precision" : null }, " has_dependents" : false
2989
2943
}$j$
2990
2944
);
2991
2945
RETURN NEXT ok(
2992
- jsonb_array_length(col_info - > 4 - > ' current_role_priv' ) > 0
2993
- AND jsonb_array_length(col_info - > 4 - > ' valid_target_types' ) > 0 ,
2994
- ' current_role_priv and valid_target_types should be non-empty jsonb arrays'
2946
+ jsonb_array_length(col_info - > 4 - > ' current_role_priv' ) > 0 ,
2947
+ ' current_role_priv should be a non-empty jsonb array'
2995
2948
);
2996
2949
2997
2950
-- Column 6
2998
2951
RETURN NEXT is(
2999
- (col_info - > 5 ) - ARRAY[' current_role_priv' , ' valid_target_types ' ],
2952
+ (col_info - > 5 ) - ARRAY[' current_role_priv' ],
3000
2953
$j${
3001
2954
" id" : 6 , " name" : " int_arr" , " type" : " _array" , " default" : null , " nullable" : true,
3002
2955
" description" : null , " primary_key" : false, " type_options" : {" item_type" : " integer" },
3003
2956
" has_dependents" : false
3004
2957
}$j$
3005
2958
);
3006
2959
RETURN NEXT ok(
3007
- jsonb_array_length(col_info - > 5 - > ' current_role_priv' ) > 0
3008
- AND col_info - > 5 - > ' valid_target_types' = ' null' ::jsonb,
3009
- ' current_role_priv non-empty array, valid_target_types null'
2960
+ jsonb_array_length(col_info - > 5 - > ' current_role_priv' ) > 0 ,
2961
+ ' current_role_priv should be a non-empty jsonb array'
3010
2962
);
3011
2963
3012
2964
-- Column 7
3013
2965
RETURN NEXT is(
3014
- (col_info - > 6 ) - ARRAY[' current_role_priv' , ' valid_target_types ' ],
2966
+ (col_info - > 6 ) - ARRAY[' current_role_priv' ],
3015
2967
$j${
3016
2968
" id" : 7 , " name" : " num_opt_arr" , " type" : " _array" , " default" : null , " nullable" : true,
3017
2969
" description" : null , " primary_key" : false,
@@ -3020,9 +2972,8 @@ BEGIN
3020
2972
}$j$
3021
2973
);
3022
2974
RETURN NEXT ok(
3023
- jsonb_array_length(col_info - > 6 - > ' current_role_priv' ) > 0
3024
- AND col_info - > 6 - > ' valid_target_types' = ' null' ::jsonb,
3025
- ' current_role_priv non-empty array, valid_target_types null'
2975
+ jsonb_array_length(col_info - > 6 - > ' current_role_priv' ) > 0 ,
2976
+ ' current_role_priv should be a non-empty jsonb array'
3026
2977
);
3027
2978
END;
3028
2979
$$ LANGUAGE plpgsql;
0 commit comments