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

fix: Use BulkImportUser instead of BulkImportUserInfo #200

Merged
merged 12 commits into from
Feb 28, 2024
3 changes: 1 addition & 2 deletions src/main/java/io/supertokens/storage/postgresql/Start.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import io.supertokens.pluginInterface.authRecipe.LoginMethod;
import io.supertokens.pluginInterface.authRecipe.sqlStorage.AuthRecipeSQLStorage;
import io.supertokens.pluginInterface.bulkimport.BulkImportUser;
import io.supertokens.pluginInterface.bulkimport.BulkImportUserInfo;
import io.supertokens.pluginInterface.bulkimport.sqlStorage.BulkImportSQLStorage;
import io.supertokens.pluginInterface.dashboard.DashboardSearchTags;
import io.supertokens.pluginInterface.dashboard.DashboardSessionInfo;
Expand Down Expand Up @@ -3065,7 +3064,7 @@ public void addBulkImportUsers(AppIdentifier appIdentifier, List<BulkImportUser>
}

@Override
public List<BulkImportUserInfo> getBulkImportUsers(AppIdentifier appIdentifier, @Nonnull Integer limit, @Nullable BulkImportUserStatus status,
public List<BulkImportUser> getBulkImportUsers(AppIdentifier appIdentifier, @Nonnull Integer limit, @Nullable BulkImportUserStatus status,
@Nullable String bulkImportUserId, @Nullable Long createdAt) throws StorageQueryException {
try {
return BulkImportQueries.getBulkImportUsers(this, appIdentifier, limit, status, bulkImportUserId, createdAt);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import io.supertokens.pluginInterface.RowMapper;
import io.supertokens.pluginInterface.bulkimport.BulkImportStorage.BulkImportUserStatus;
import io.supertokens.pluginInterface.bulkimport.BulkImportUser;
import io.supertokens.pluginInterface.bulkimport.BulkImportUserInfo;
import io.supertokens.pluginInterface.exceptions.StorageQueryException;
import io.supertokens.pluginInterface.multitenancy.AppIdentifier;
import io.supertokens.storage.postgresql.Start;
Expand Down Expand Up @@ -126,7 +125,7 @@ public static void updateBulkImportUserStatus_Transaction(Start start, Connectio
});
}

public static List<BulkImportUserInfo> getBulkImportUsers(Start start, AppIdentifier appIdentifier, @Nonnull Integer limit, @Nullable BulkImportUserStatus status,
public static List<BulkImportUser> getBulkImportUsers(Start start, AppIdentifier appIdentifier, @Nonnull Integer limit, @Nullable BulkImportUserStatus status,
@Nullable String bulkImportUserId, @Nullable Long createdAt)
throws SQLException, StorageQueryException {

Expand Down Expand Up @@ -161,27 +160,27 @@ public static List<BulkImportUserInfo> getBulkImportUsers(Start start, AppIdenti
pst.setObject(i + 1, parameters.get(i));
}
}, result -> {
List<BulkImportUserInfo> bulkImportUsers = new ArrayList<>();
List<BulkImportUser> bulkImportUsers = new ArrayList<>();
while (result.next()) {
bulkImportUsers.add(BulkImportUserInfoRowMapper.getInstance().mapOrThrow(result));
bulkImportUsers.add(BulkImportUserRowMapper.getInstance().mapOrThrow(result));
}
return bulkImportUsers;
});
}

private static class BulkImportUserInfoRowMapper implements RowMapper<BulkImportUserInfo, ResultSet> {
private static final BulkImportUserInfoRowMapper INSTANCE = new BulkImportUserInfoRowMapper();
private static class BulkImportUserRowMapper implements RowMapper<BulkImportUser, ResultSet> {
private static final BulkImportUserRowMapper INSTANCE = new BulkImportUserRowMapper();

private BulkImportUserInfoRowMapper() {
private BulkImportUserRowMapper() {
}

private static BulkImportUserInfoRowMapper getInstance() {
private static BulkImportUserRowMapper getInstance() {
return INSTANCE;
}

@Override
public BulkImportUserInfo map(ResultSet result) throws Exception {
return new BulkImportUserInfo(result.getString("id"), result.getString("raw_data"),
public BulkImportUser map(ResultSet result) throws Exception {
return BulkImportUser.fromDBJson(result.getString("id"), result.getString("raw_data"),
BulkImportUserStatus.valueOf(result.getString("status")),
result.getLong("created_at"), result.getLong("updated_at"));
}
Expand Down
Loading