Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -809,10 +809,10 @@ public void setClientInfo(Properties properties) throws SQLClientInfoException {
public Properties getClientInfo() throws SQLException { return new Properties(); }

@Override
public Array createArrayOf(String typeName, Object[] elements) throws SQLException { throw new UnsupportedOperationException(); }
public Array createArrayOf(String typeName, Object[] elements) throws SQLException { throw new SQLFeatureNotSupportedException("createArrayOf is not supported"); }

@Override
public Struct createStruct(String typeName, Object[] attributes) throws SQLException { throw new UnsupportedOperationException(); }
public Struct createStruct(String typeName, Object[] attributes) throws SQLException { throw new SQLFeatureNotSupportedException("createStruct is not supported"); }

@Override
public void setSchema(String schema) throws SQLException {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import java.sql.BatchUpdateException;
import java.sql.SQLException;
import java.sql.SQLFeatureNotSupportedException;
import java.sql.SQLIntegrityConstraintViolationException;
import java.sql.SQLTransientConnectionException;
import java.util.ArrayList;
Expand Down Expand Up @@ -54,6 +55,19 @@ void getMetaDataIsCachedPerConnection() throws SQLException {
assertThat(other.getMetaData()).isNotSameAs(connection.getMetaData());
}

@Test
void createArrayOfAndCreateStructThrowFeatureNotSupported() throws SQLException {
LibsqlConnection connection = new LibsqlConnection(
CONFIG, new ScriptedClient((request, index) -> successResponse(request)));

assertThatThrownBy(() -> connection.createArrayOf("INTEGER", new Object[0]))
.isExactlyInstanceOf(SQLFeatureNotSupportedException.class)
.hasMessage("createArrayOf is not supported");
assertThatThrownBy(() -> connection.createStruct("point", new Object[0]))
.isExactlyInstanceOf(SQLFeatureNotSupportedException.class)
.hasMessage("createStruct is not supported");
}

@Test
void metadataReportsTheJdbcUrlUsedToConnect() throws SQLException {
LibsqlConnection connection = new LibsqlConnection(
Expand Down
Loading