/*
 * Copyright (c) 2023 codvision.com All Rights Reserved.
 */

package com.codvision.db.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 数据库类型
 *
 * @author lingee
 * @date 2023/12/5
 */
@Getter
@AllArgsConstructor
public enum DbTypeEnum {

    /**
     * mysql数据库
     */
    mysql("mysql"),

    /**
     * pgsql数据库
     */
    postgresql("postgresql");

    private final String type;

    public static DbTypeEnum resolve(String type) {
        for (DbTypeEnum value : values()) {
            if (value.getType().equals(type)) {
                return value;
            }
        }
        throw new EnumConstantNotPresentException(DbTypeEnum.class, type);
    }
}
