Skip to content
This repository was archived by the owner on Oct 6, 2022. It is now read-only.
This repository was archived by the owner on Oct 6, 2022. It is now read-only.

Querybuilder For with selectInserted set to true throws InvalidOperationException #33

Description

@Syzuna

Summary
When trying to do a bulk insert with a for and asking to select the inserted objects the query builder throws an InvalidOperationException because it cant wrap a global query.

Code

        return await QueryBuilder
            .For(factions, faction => QueryBuilder.Insert(faction, true))
            .ExecuteAsync(_edgeDb, token: cancellationToken);

Stacktrace

System.InvalidOperationException: Cannot wrap a global-defined query    at EdgeDB.QueryNodes.SelectNode.FinalizeQuery()    at EdgeDB.QueryNodes.ForNode.<FinalizeQuery>b__3_0(QueryNode x)    at System.Linq.Enumerable.SelectListIterator`2.MoveNext()    at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()    at System.Linq.Enumerable.Aggregate[TSource](IEnumerable`1 source, Func`3 func)    at EdgeDB.QueryNodes.ForNode.FinalizeQuery()    at EdgeDB.QueryBuilder`2.InternalBuild(Boolean includeGlobalsInQuery, Action`1 preFinalizerModifier)    at EdgeDB.QueryBuilder`2.IntrospectAndBuildAsync(IEdgeDBQueryable edgedb, CancellationToken token)    at EdgeDB.QueryBuilder`2.EdgeDB.Interfaces.IMultiCardinalityExecutable<TType>.ExecuteAsync(IEdgeDBQueryable edgedb, Nullable`1 capabilities, CancellationToken token)    at SyzunaPrograms.ED.EDCIA.DataImport.Data.Repositories.FactionRepository.InsertFactionsAsync(Faction[] factions, CancellationToken cancellationToken)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions