package org.beetl.sql.core.nosql;

import org.beetl.sql.core.db.AbstractDBStyle;
import org.beetl.sql.core.db.DBType;
import org.beetl.sql.core.range.OffsetLimitRange;
import org.beetl.sql.core.range.RangeSql;

import java.util.Collection;

/**
 *
 * @author xiandafu
 * @see "http://endoc.machbase.com/display/MANUAL/JDBC"
 * @see "https://hub.docker.com/r/machbase/machbase"
 * @see "http://endoc.machbase.com/display/MANUAL/Creation+and+Dropping+of+Tag+table"
 *
 */
public class MachbaseStyle  extends AbstractDBStyle {

    RangeSql rangeSql = null;
    public MachbaseStyle() {
        super();
        //同mysql
        rangeSql = new OffsetLimitRange(this);
    }

    @Override
    public int getIdType(Class c,String idProperty) {
        //只支持
        return DBType.ID_ASSIGN;
    }

    @Override
    public boolean  isNoSql(){
        return true;
    }
    @Override
    public String getName() {
        return "clickhouse";
    }

    @Override
    public int getDBType() {
        return DBType.DB_CLICKHOUSE;
    }

    @Override
    public RangeSql getRangeSql() {
        return rangeSql;
    }

    @Override
    protected void checkId(Collection colsId, Collection attrsId, String clsName) {
        // 不检测主键
        return ;
    }



}
