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

com.jn.nacos.plugin.datasource.db.postgresql.PostgresDatabaseDialect Maven / Gradle / Ivy

The newest version!
package com.jn.nacos.plugin.datasource.db.postgresql;

import com.jn.nacos.plugin.datasource.DatabaseNames;
import com.jn.nacos.plugin.datasource.IdentifierQuotedMode;
import com.jn.nacos.plugin.datasource.NacosDatabaseDialect;
import com.jn.sqlhelper.dialect.SqlCompatibilityType;

public class PostgresDatabaseDialect extends NacosDatabaseDialect {
    public PostgresDatabaseDialect() {
        super(DatabaseNames.POSTGRESQL);
        this.identifierQuotedMode = IdentifierQuotedMode.QUOTED;
    }

    @Override
    public boolean isAutoCastEmptyStringToNull(SqlCompatibilityType sqlCompatibilityType) {
        return false;
    }

    @Override
    public String genCastNullToDefaultExpression(String expressionOrIdentifier, String defaultValue) {
        return " COALESCE("+expressionOrIdentifier+", '"+defaultValue+"') ";
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy