GithubHelp home page GithubHelp logo

Comments (3)

mattbdc avatar mattbdc commented on August 20, 2024

I guess I need this to start at 1 somehow
NpgsqlModificationCommandBatch

from efcore.pg.

mattbdc avatar mattbdc commented on August 20, 2024

So it's possible with providing your own NpgsqlModificationCommandBatchFactory and return a version of NpgsqlModificationCommandBatch that works out reader.Statements - ModificationCommands.Count are prefix commands then npgsqlReader.Statements[commandIndex + numberOfPrefixCommands].Rows !=1 but I think I'm just going to take the pain of round tripping a select set_config at the start of begin transaction as completely seperate command.

This got ugly, complicated, and yeah overkill quickly whoops. This can be closed if on same page.

from efcore.pg.

roji avatar roji commented on August 20, 2024

There's unfortunately no good way to do this currently, without hacking around with internal types etc... One way to address this would be npgsql/npgsql#4522, which would allow prepending SQL at the lower-level Npgsql level. This has come up before.

For now, if you're not too concerned about the perf overhead of performing another database roundtrip, it's true that that's probably the simplest way.

I'll go ahead and close this as I don't really see a solution inside EF or EFCore.PG itself... But of course feel free to post back here and we can continue the conversation.

from efcore.pg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.