All Downloads are FREE. Search and download functionalities are using the official Maven repository.

sqlancer.clickhouse.gen.ClickHouseCommon Maven / Gradle / Ivy

Go to download

SQLancer finds logic bugs in Database Management Systems through automatic testing

There is a newer version: 2.0.0
Show newest version
package sqlancer.clickhouse.gen;

import java.util.ArrayList;
import java.util.List;

import sqlancer.clickhouse.ClickHouseSchema;
import sqlancer.clickhouse.ast.ClickHouseExpression;
import sqlancer.clickhouse.ast.ClickHouseTableReference;

public final class ClickHouseCommon {

    private ClickHouseCommon() {
    }

    public static String createColumnName(int nr) {
        return String.format("c%d", nr);
    }

    public static String createTableName(int nr) {
        return String.format("t%d", nr);
    }

    public static String createConstraintName(int nr) {
        return String.format("x%d", nr);
    }

    public static List getTableRefs(List tables,
            ClickHouseSchema s) {
        List tableRefs = new ArrayList<>();
        for (ClickHouseSchema.ClickHouseTable t : tables) {
            ClickHouseTableReference tableRef;
            tableRef = new ClickHouseTableReference(t);
            tableRefs.add(tableRef);
        }
        return tableRefs;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy