use of io.questdb.cairo.sql.Function in project questdb by bluestreak01.
the class BindVariableServiceImpl method setBin.
@Override
public void setBin(int index, BinarySequence value) throws SqlException {
indexedVariables.extendPos(index + 1);
Function function = indexedVariables.getQuick(index);
if (function == null) {
indexedVariables.setQuick(index, new BinBindVariable(value));
} else if (function instanceof BinBindVariable) {
((BinBindVariable) function).value = value;
} else {
throw SqlException.$(0, "bind variable at ").put(index).put(" is already defined as ").put(ColumnType.nameOf(function.getType()));
}
}
use of io.questdb.cairo.sql.Function in project questdb by bluestreak01.
the class BindVariableServiceImpl method setDouble.
@Override
public void setDouble(int index, double value) throws SqlException {
indexedVariables.extendPos(index + 1);
// variable exists
Function function = indexedVariables.getQuick(index);
if (function != null) {
setDouble0(function, value, index, null);
} else {
indexedVariables.setQuick(index, function = doubleVarPool.next());
((DoubleBindVariable) function).value = value;
}
}
use of io.questdb.cairo.sql.Function in project questdb by bluestreak01.
the class BindVariableServiceImpl method setShort.
@Override
public void setShort(int index, short value) throws SqlException {
indexedVariables.extendPos(index + 1);
// variable exists
Function function = indexedVariables.getQuick(index);
if (function != null) {
setShort0(function, value, index, null);
} else {
indexedVariables.setQuick(index, function = shortVarPool.next());
((ShortBindVariable) function).value = value;
}
}
use of io.questdb.cairo.sql.Function in project questdb by bluestreak01.
the class BindVariableServiceImpl method setTimestamp.
@Override
public void setTimestamp(int index, long value) throws SqlException {
indexedVariables.extendPos(index + 1);
// variable exists
Function function = indexedVariables.getQuick(index);
if (function != null) {
setTimestamp0(function, value, index);
} else {
indexedVariables.setQuick(index, function = timestampVarPool.next());
((TimestampBindVariable) function).value = value;
}
}
use of io.questdb.cairo.sql.Function in project questdb by bluestreak01.
the class BindVariableServiceImpl method setBoolean.
@Override
public void setBoolean(int index, boolean value) throws SqlException {
indexedVariables.extendPos(index + 1);
// variable exists
Function function = indexedVariables.getQuick(index);
if (function != null) {
setBoolean0(function, value, index, null);
} else {
indexedVariables.setQuick(index, function = booleanVarPool.next());
((BooleanBindVariable) function).value = value;
}
}
Aggregations