Git Product home page Git Product logo

Comments (2)

roji avatar roji commented on June 7, 2024 2

I'm not sure why Yugabyte has its own fork of Npgsql, with a special DbConnection of its own; that approach is generally not going to work well with EF (and various other ORMs). For example, you'll also have to override parts of Npgsql.EntityFrameworkCore.PostgreSQL itself so that it doesn't internally instantiate an NpgsqlConnection when given a connection string, but rather a Yugabyte connection. There may be other places as well were such customizations would be needed.

At the end of the day, if Yugabyte created their fork of Npgsql, then it's a different driver, and won't necessarily be compatible with Npgsql; even if we introduce an interface over CloneWith specifically, actual behavioral changes will invariably creep in as Npgsql evolves, which may affect how the EF provider works.

In any case, the dependency on CloneWith specifically is only needed when you use EF to create the database (e.g. with EnsureCreated). If you simply create the database externally (which is what you should be doing anyway in a real app) and refrain from calling EnsureCreated, you shouldn't run into this. Or are you seeing something different?

from efcore.pg.

someonestolemyusername avatar someonestolemyusername commented on June 7, 2024

Thanks for replying! You are spot on that the error was occurring when I was running migrations. It also seems to fail during normal operations for a subset of queries - for example:

      System.InvalidOperationException: Npgsql-specific type mapping NpgsqlStringTypeMapping being used with non-Npgsql parameter type NpgsqlParameter
         at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.Mapping.NpgsqlStringTypeMapping.ConfigureParameter(DbParameter parameter)
         at Microsoft.EntityFrameworkCore.Storage.RelationalTypeMapping.CreateParameter(DbCommand command, String name, Object value, Nullable`1 nullable, ParameterDirection direction)

At any rate for my use, the unmodified npgsql driver is excellent. I think this is an issue for the Yugabyte people to resolve, if they want to imo.

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.