Skip to content

Commit 7714471

Browse files
authored
fix: Use BulkImportUser instead of BulkImportUserInfo (#200)
* feat: Add bulk import queries * fix: PR changes * fix: PR changes * fix: PR changes * fix: PR changes * fix: PR changes * fix: PR changes * fix: PR changes * fix: PR changes * fix: PR changes
1 parent 6eccbf6 commit 7714471

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

src/main/java/io/supertokens/storage/postgresql/Start.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import io.supertokens.pluginInterface.authRecipe.LoginMethod;
2727
import io.supertokens.pluginInterface.authRecipe.sqlStorage.AuthRecipeSQLStorage;
2828
import io.supertokens.pluginInterface.bulkimport.BulkImportUser;
29-
import io.supertokens.pluginInterface.bulkimport.BulkImportUserInfo;
3029
import io.supertokens.pluginInterface.bulkimport.sqlStorage.BulkImportSQLStorage;
3130
import io.supertokens.pluginInterface.dashboard.DashboardSearchTags;
3231
import io.supertokens.pluginInterface.dashboard.DashboardSessionInfo;
@@ -3065,7 +3064,7 @@ public void addBulkImportUsers(AppIdentifier appIdentifier, List<BulkImportUser>
30653064
}
30663065

30673066
@Override
3068-
public List<BulkImportUserInfo> getBulkImportUsers(AppIdentifier appIdentifier, @Nonnull Integer limit, @Nullable BulkImportUserStatus status,
3067+
public List<BulkImportUser> getBulkImportUsers(AppIdentifier appIdentifier, @Nonnull Integer limit, @Nullable BulkImportUserStatus status,
30693068
@Nullable String bulkImportUserId, @Nullable Long createdAt) throws StorageQueryException {
30703069
try {
30713070
return BulkImportQueries.getBulkImportUsers(this, appIdentifier, limit, status, bulkImportUserId, createdAt);

src/main/java/io/supertokens/storage/postgresql/queries/BulkImportQueries.java

+9-10
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import io.supertokens.pluginInterface.RowMapper;
3232
import io.supertokens.pluginInterface.bulkimport.BulkImportStorage.BulkImportUserStatus;
3333
import io.supertokens.pluginInterface.bulkimport.BulkImportUser;
34-
import io.supertokens.pluginInterface.bulkimport.BulkImportUserInfo;
3534
import io.supertokens.pluginInterface.exceptions.StorageQueryException;
3635
import io.supertokens.pluginInterface.multitenancy.AppIdentifier;
3736
import io.supertokens.storage.postgresql.Start;
@@ -126,7 +125,7 @@ public static void updateBulkImportUserStatus_Transaction(Start start, Connectio
126125
});
127126
}
128127

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

@@ -161,27 +160,27 @@ public static List<BulkImportUserInfo> getBulkImportUsers(Start start, AppIdenti
161160
pst.setObject(i + 1, parameters.get(i));
162161
}
163162
}, result -> {
164-
List<BulkImportUserInfo> bulkImportUsers = new ArrayList<>();
163+
List<BulkImportUser> bulkImportUsers = new ArrayList<>();
165164
while (result.next()) {
166-
bulkImportUsers.add(BulkImportUserInfoRowMapper.getInstance().mapOrThrow(result));
165+
bulkImportUsers.add(BulkImportUserRowMapper.getInstance().mapOrThrow(result));
167166
}
168167
return bulkImportUsers;
169168
});
170169
}
171170

172-
private static class BulkImportUserInfoRowMapper implements RowMapper<BulkImportUserInfo, ResultSet> {
173-
private static final BulkImportUserInfoRowMapper INSTANCE = new BulkImportUserInfoRowMapper();
171+
private static class BulkImportUserRowMapper implements RowMapper<BulkImportUser, ResultSet> {
172+
private static final BulkImportUserRowMapper INSTANCE = new BulkImportUserRowMapper();
174173

175-
private BulkImportUserInfoRowMapper() {
174+
private BulkImportUserRowMapper() {
176175
}
177176

178-
private static BulkImportUserInfoRowMapper getInstance() {
177+
private static BulkImportUserRowMapper getInstance() {
179178
return INSTANCE;
180179
}
181180

182181
@Override
183-
public BulkImportUserInfo map(ResultSet result) throws Exception {
184-
return new BulkImportUserInfo(result.getString("id"), result.getString("raw_data"),
182+
public BulkImportUser map(ResultSet result) throws Exception {
183+
return BulkImportUser.fromDBJson(result.getString("id"), result.getString("raw_data"),
185184
BulkImportUserStatus.valueOf(result.getString("status")),
186185
result.getLong("created_at"), result.getLong("updated_at"));
187186
}

0 commit comments

Comments
 (0)