Repository: appsmithorg/appsmith
File: app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ce/CustomDatasourceRepositoryCEImpl.java (Java)

Code before:
    @Override
    public Flux<Datasource> findAllByWorkspaceId(String workspaceId, AclPermission permission) {
        Sort sort = Sort.by(Datasource.Fields.name);
        return queryBuilder()
                .criteria(Bridge.equal(Datasource.Fields.workspaceId, workspaceId))
                .permission(permission)
                .sort(sort)
                .all();
    }

    @Override
    public Mono<Datasource> findByNameAndWorkspaceId(String name, String workspaceId, AclPermission aclPermission) {
        return queryBuilder()
                .criteria(Bridge.equal(Datasource.Fields.name, name).equal(Datasource.Fields.workspaceId, workspaceId))
                .permission(aclPermission)
                .one();
    }

    @Override
    public Flux<Datasource> findByWorkspaceId(String workspaceId, AclPermission aclPermission) {
        final BridgeQuery<Datasource> q = Bridge.equal(Datasource.Fields.workspaceId, workspaceId);
        return queryBuilder().criteria(q).permission(aclPermission).all();
    }

    @Override
    public Flux<Datasource> findAllByWorkspaceIdWithoutPermissions(String workspaceId) {
        final BridgeQuery<Datasource> q = Bridge.equal(Datasource.Fields.workspaceId, workspaceId);
        return queryBuilder().criteria(q).all();
    }

    @Override
    public Flux<Datasource> findByIdIn(List<String> ids) {
        final BridgeQuery<Datasource> q = Bridge.in(Datasource.Fields.id, ids);
        return queryBuilder().criteria(q).all();
    }

    @Override
    public Mono<Long> countByDeletedAtNull() {
        final BridgeQuery<Datasource> q = Bridge.isNull(Datasource.Fields.deletedAt);
        return queryBuilder().criteria(q).count();
    }
}


Review comment (bug):
I think you are replacing `Flux<Datasource> findAllByWorkspaceId(String workspaceId);` but this may result in build failures if the same method is used in EE, have we checked that?

Code after:
    @Override
    public Flux<Datasource> findAllByWorkspaceId(String workspaceId, AclPermission permission) {
        Sort sort = Sort.by(Datasource.Fields.name);
        return queryBuilder()
                .criteria(Bridge.equal(Datasource.Fields.workspaceId, workspaceId))
                .permission(permission)
                .sort(sort)
                .all();
    }

    @Override
    public Mono<Datasource> findByNameAndWorkspaceId(String name, String workspaceId, AclPermission aclPermission) {
        return queryBuilder()
                .criteria(Bridge.equal(Datasource.Fields.name, name).equal(Datasource.Fields.workspaceId, workspaceId))
                .permission(aclPermission)
                .one();
    }

    @Override
    public Flux<Datasource> findByIdIn(List<String> ids) {
        final BridgeQuery<Datasource> q = Bridge.in(Datasource.Fields.id, ids);
        return queryBuilder().criteria(q).all();
    }

    @Override
    public Mono<Long> countByDeletedAtNull() {
        final BridgeQuery<Datasource> q = Bridge.isNull(Datasource.Fields.deletedAt);
        return queryBuilder().criteria(q).count();
    }
}