import { ReferenceKind } from '@mikro-orm/core';
import { prepareMetadataContext } from '../utils.js';
/** Defines a computed SQL formula property on an entity (TC39 decorator). */
export function Formula(formula, options = {}) {
  return function (value, context) {
    const meta = prepareMetadataContext(context);
    meta.properties[context.name] = {
      name: context.name,
      kind: ReferenceKind.SCALAR,
      formula,
      ...options,
    };
  };
}
