Deprecate object metadata maps in favor of flat entities (#16080)
## Context Deprecating the old objectMetadataMap type in favour of split flat entities to match with our new caching. In the long run, trying to achieve: - Better performance through caching - Consistent data access patterns across the codebase - Reduced database queries Now that everything is based on flat entities, which are cached, we can finish the refactoring of workspace context cache which should already improve performances. Then the last step will be to consume that new cache in the new global datasource to get rid of the many workspace datasources stored in the server
This commit is contained in:
+5
-8
@@ -3,7 +3,6 @@ import {
|
||||
type CompositeProperty,
|
||||
} from 'twenty-shared/types';
|
||||
|
||||
import { type FieldMetadataEntity } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity';
|
||||
import {
|
||||
FieldMetadataException,
|
||||
FieldMetadataExceptionCode,
|
||||
@@ -19,8 +18,8 @@ export type FieldTypeAndNameMetadata = {
|
||||
};
|
||||
|
||||
// TODO: If we need to implement custom name logic for columns, we can do it here
|
||||
export function computeColumnName<T extends FieldMetadataType>(
|
||||
fieldMetadataOrFieldName: FieldMetadataEntity<T> | string,
|
||||
export function computeColumnName(
|
||||
fieldMetadataOrFieldName: FieldTypeAndNameMetadata | string,
|
||||
options?: ComputeColumnNameOptions,
|
||||
): string {
|
||||
const generateName = (name: string) => {
|
||||
@@ -40,11 +39,9 @@ export function computeColumnName<T extends FieldMetadataType>(
|
||||
|
||||
return generateName(fieldMetadataOrFieldName.name);
|
||||
}
|
||||
export function computeCompositeColumnName<T extends FieldMetadataType>(
|
||||
fieldMetadataOrFieldName:
|
||||
| FieldTypeAndNameMetadata
|
||||
| FieldMetadataEntity<T>
|
||||
| string,
|
||||
|
||||
export function computeCompositeColumnName(
|
||||
fieldMetadataOrFieldName: FieldTypeAndNameMetadata | string,
|
||||
compositeProperty: CompositeProperty,
|
||||
): string {
|
||||
const generateName = (name: string) => {
|
||||
|
||||
Reference in New Issue
Block a user