import { Type } from './Type.js';
/** Maps a database ENUM or equivalent column to a JS string. Supports native database enums when available. */
export class EnumType extends Type {
  getColumnType(prop, platform) {
    if (prop.nativeEnumName) {
      return prop.nativeEnumName;
    }
    return prop.columnTypes?.[0] ?? platform.getEnumTypeDeclarationSQL(prop);
  }
  compareAsType() {
    return 'string';
  }
  ensureComparable() {
    return false;
  }
}
