Jake
Jake

Reputation: 673

Prepared statements in timestream

I would like to execute a prepared statement to query my Timestream database.

I've looked through the documentation and found prepare_query, however, it's very unclear to me what this actually does. It seems that all it can do is verify that the input is a correctly formatted prepared statement.

Then there is the query method, which only accepts a QueryString parameter. There is nowhere to supply parameters or reference a stored prepared statement.

Are prepared statements supported by the Timestream API? If so, how do I use them?

Upvotes: 1

Views: 602

Answers (2)

Gaurav Wadhone
Gaurav Wadhone

Reputation: 144

We are connecting it via Java instead of python.
I assume same feature will be with boto3
Our java maven package is amazon-timestream-jdbc with version 1.0.2 It support prepare statement however you can't set values to them. so actually its useless.

In its source code it has below line for each setter in prepare statement (TimestreamPreparedStatement.java).

public void setString(int parameterIndex, String x) throws SQLException {
    this.verifyOpen();
    throw new SQLFeatureNotSupportedException(Error.lookup(Error.PARAMETERS_NOT_SUPPORTED, new Object[0]));
}

Upvotes: 1

Dominic Preuss
Dominic Preuss

Reputation: 697

Timestream doesn't support prepared statements. You would need to implement in your client code (but won't help query performance).

Upvotes: 2

Related Questions