Supported kw arguments are: ``dblink`` to reflect via a db link; ``oracle_resolve_synonyms`` to resolve names to synonyms
(
self,
connection,
*,
schema,
filter_names,
scope,
kind,
dblink=None,
**kw,
)
| 2958 | |
| 2959 | @_handle_synonyms_decorator |
| 2960 | def get_multi_columns( |
| 2961 | self, |
| 2962 | connection, |
| 2963 | *, |
| 2964 | schema, |
| 2965 | filter_names, |
| 2966 | scope, |
| 2967 | kind, |
| 2968 | dblink=None, |
| 2969 | **kw, |
| 2970 | ): |
| 2971 | """Supported kw arguments are: ``dblink`` to reflect via a db link; |
| 2972 | ``oracle_resolve_synonyms`` to resolve names to synonyms |
| 2973 | """ |
| 2974 | owner = self.denormalize_schema_name( |
| 2975 | schema or self.default_schema_name |
| 2976 | ) |
| 2977 | query = self._column_query(owner) |
| 2978 | |
| 2979 | if ( |
| 2980 | filter_names |
| 2981 | and kind is ObjectKind.ANY |
| 2982 | and scope is ObjectScope.ANY |
| 2983 | ): |
| 2984 | all_objects = [self.denormalize_name(n) for n in filter_names] |
| 2985 | else: |
| 2986 | all_objects = self._get_all_objects( |
| 2987 | connection, schema, scope, kind, filter_names, dblink, **kw |
| 2988 | ) |
| 2989 | |
| 2990 | columns = defaultdict(list) |
| 2991 | |
| 2992 | # all_tab_cols.data_default is LONG |
| 2993 | result = self._run_batches( |
| 2994 | connection, |
| 2995 | query, |
| 2996 | dblink, |
| 2997 | returns_long=True, |
| 2998 | mappings=True, |
| 2999 | all_objects=all_objects, |
| 3000 | ) |
| 3001 | |
| 3002 | def maybe_int(value): |
| 3003 | if isinstance(value, float) and value.is_integer(): |
| 3004 | return int(value) |
| 3005 | else: |
| 3006 | return value |
| 3007 | |
| 3008 | remove_size = re.compile(r"\(\d+\)") |
| 3009 | |
| 3010 | for row_dict in result: |
| 3011 | table_name = self.normalize_name(row_dict["table_name"]) |
| 3012 | orig_colname = row_dict["column_name"] |
| 3013 | colname = self.normalize_name(orig_colname) |
| 3014 | coltype = row_dict["data_type"] |
| 3015 | precision = maybe_int(row_dict["data_precision"]) |
| 3016 | |
| 3017 | if coltype == "NUMBER": |
nothing calls this directly
no test coverage detected