Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[master] Performance tests improvement - use EmulatedDB #2130

Merged
merged 2 commits into from
May 17, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,20 @@
public class EmulatedConnection implements Connection {
protected Map<String, List<DatabaseRecord>> rows;
protected Connection connection;
protected DatabaseMetaData databaseMetaData;
private String url;
private Properties info;

public EmulatedConnection() {
this.rows = new HashMap<>();
}

public EmulatedConnection(String url, Properties info) {
this();
this.url = url;
this.info = info;
}

public EmulatedConnection(Connection connection) {
this();
this.connection = connection;
Expand Down Expand Up @@ -330,7 +339,10 @@ public DatabaseMetaData getMetaData() throws SQLException {
if (connection != null) {
return connection.getMetaData();
rfelcman marked this conversation as resolved.
Show resolved Hide resolved
}
return null;
if (this.databaseMetaData == null) {
this.databaseMetaData = new EmulatedDatabaseMetaData(this);
}
return this.databaseMetaData;
}

/**
Expand Down Expand Up @@ -1021,4 +1033,12 @@ public void abort(Executor executor) throws SQLException {}

@Override
public void setSchema(String schema) throws SQLException {}

public String getURL() {
return this.url;
}

public Properties getInfo() {
return this.info;
}
}