Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 31 2019 21:30
    roji commented #2307
  • Jan 31 2019 20:35
    YohDeadfall commented #2307
  • Jan 31 2019 10:20
    capan starred npgsql/npgsql
  • Jan 31 2019 06:10
    SeanFarrow synchronize #2308
  • Jan 30 2019 20:37
    austindrenski commented #2308
  • Jan 30 2019 20:37
    pentagra commented #1445
  • Jan 30 2019 20:33
    SeanFarrow commented #2308
  • Jan 30 2019 20:31
    austindrenski commented #2308
  • Jan 30 2019 20:27
    SeanFarrow commented #2308
  • Jan 30 2019 20:09
    austindrenski labeled #2308
  • Jan 30 2019 20:05
    roji commented #1520
  • Jan 30 2019 19:50
    gyzod commented #1445
  • Jan 30 2019 19:06
    SeanFarrow commented #1520
  • Jan 30 2019 18:54
    roji commented #1520
  • Jan 30 2019 18:53
    roji commented #1520
  • Jan 30 2019 18:52
    roji commented #2050
  • Jan 30 2019 18:45
    Trolldemorted commented #2050
  • Jan 30 2019 18:21
    SeanFarrow commented #1520
  • Jan 30 2019 18:16
    SeanFarrow review_requested #2308
  • Jan 30 2019 18:16
    SeanFarrow review_requested #2308
eraffel-MDSol
@eraffel-MDSol
thx
Yoh Deadfall
@YohDeadfall
Maybe 4.1.6 will be a bit earlier since it's ready actually and nothing prevents us from publishing it.
So I think will release the patch as soon as wake up and turn the PC (:
nelthaarion
@nelthaarion
hi, when do you release .net5 version !
Yoh Deadfall
@YohDeadfall
Please read the thread carefully, it was answered above.
Shay Rojansky
@roji
@yousiftouma you should be able to use the methods on the Convert class to convert string to int
nelthaarion
@nelthaarion
this countdown will kill me :D
Gosu_Bob
@BoZhu14225250_twitter
Hi Anyone there,i need some help installing this npgsql
For my master study project
Gosu_Bob
@BoZhu14225250_twitter
I successfully install it.Thanks
FerrariF70
@FerrariF70
Hello. I need help. I'm using .NET Framework 4.8 and I want to understand how set up SSL connection. I know that I need write in connection string that parameter SSLMode=Require, but what I need to write in code, that for checking user certificate. Thanks in advance!
Yoh Deadfall
@YohDeadfall
You need to check the server certificate or to use the client certificate? It's very different things.
FerrariF70
@FerrariF70
What do I need for enable to ssl on database? server certificate properly? because server calling to database, or do I need server certificate and client certificate for properly using ssl. I don't know how I need to use. When I connect from client to server for getting data. I get this message: "SSL connection requested. No SSL enabled connection from this host is configured" Because I set my connection string SslMode=Require
Yoh Deadfall
@YohDeadfall
Yes, to use with SSL you have both sides to support it like everywhere else, so you need to setup the server. It's well explained in the documentation for PostgreSQL: https://www.postgresql.org/docs/current/ssl-tcp.html
As an example you can see https://github.com/npgsql/npgsql/blob/main/.devcontainer/db/init-db.sh which sets up our test database in a container. In your case it's not needed, but can show what should be turned on and created. All explained in PostgreSQL by the first link.
FerrariF70
@FerrariF70
@YohDeadfall tell me, where does the best way to store certificates?
Yoh Deadfall
@YohDeadfall
Am not a security expert, so you have to read somewhere how to secure your server and limit access to it.
Alberto Passalacqua
@AlbertoPa
@FerrariF70 what server is this?
FerrariF70
@FerrariF70
@AlbertoPa I for now don't have server, but I want create on hostwinds.com
FerrariF70
@FerrariF70
@YohDeadfall thank you for help
Fabian Terhorst
@FabianTerhorst
Did someone saw this error before?
One or more errors occurred. (The type initializer for 'Npgsql.TypeMapping.GlobalTypeMapper' threw an exception.)
       ---> System.TypeInitializationException: The type initializer for 'Npgsql.TypeMapping.GlobalTypeMapper' threw an exception.
       ---> System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types.
      Could not load type 'Npgsql.Replication.PgOutput.Messages.BeginMessage' from assembly 'Npgsql, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7'.
...
Fabian Terhorst
@FabianTerhorst
got fixed by upgrading runtime from 5.0 rc1 to 5.0.0
Shimmy
@weitzhandler
Hi,
Is it possible to have an ICollection<string>-typed property mapped as jsonb?
Shimmy
@weitzhandler
what's the proper way to expose such a property so that it's never null?
FerrariF70
@FerrariF70
@weitzhandler your first question. what do you need to do? you want convert ICollection to Json? and store to your database as json type?
Shimmy
@weitzhandler
FerrariF70 thanks for your reply,
I want to expose an ICollection<T> on my entity, and have this collection be stored and retrieved to and from db as jsonb
Yoh Deadfall
@YohDeadfall
EF Core, right?
Shimmy
@weitzhandler
Yup. Here's my repro project, please see this file.
Shimmy
@weitzhandler
EF Core 5
Yoh Deadfall
@YohDeadfall
Then it's to @roji. Not an EF user (:
Shimmy
@weitzhandler
Thanks for your intention @YohDeadfall!
FerrariF70
@FerrariF70
@weitzhandler look this example
Shimmy
@weitzhandler
@FerrariF70 well, changing ICollection<T> to T[] seems to work. Is there a way to intercept the deserialization process so that ICollection<T> will work too? I rather keep my entities array-free and stick to ICollection<T>.
It works well saving the data. The problem only occurs when reading back from the db.
FerrariF70
@FerrariF70
@weitzhandler try Newtonsoft library
[JsonObject(IsReference = true)]
 public  class Customer<T>
 {
        public string Name { get; set; }
        public string LastName { get; set; }
        public ICollection<T> Orders { get; set; }
 }

 static void Main(string[] args)
{
            Customer<string> customer = new Customer<string>()
            {
                Name = "Client1",
                LastName ="...",
                Orders = new List<string>()
                {
                    "...",
                    "..."
                }
            };
            string data = JsonConvert.SerializeObject(customer);// Get data from database
            Customer<string> other = JsonConvert.DeserializeObject<Customer<string>>(data);
}
Shimmy
@weitzhandler
Is there a way to interfere with the Npgsql's serialization process or to configure it
(when data is loaded from db it's DEserialized, it's received from db as json and entitiy is filled with it as clr data, no?)
FerrariF70
@FerrariF70
I don't never used jsonb, but if it's serializing then in theory it should deserialize, what is exception do you get?
Shimmy
@weitzhandler

Thanks for bearing with me
npgsql/npgsql#3368

Is it possible to use INpgsqlTypeMapper via DI?

Shimmy
@weitzhandler
Still haven't figured out why, but changing the field type to ICollection<T> instead of HashSet<T> seems to be solving the problem
Adrian Ksiezarczyk
@adrianksiezarczyk

Hello.
I am using UseSnakeCaseNamingConvention extenstion method with communication to postgres by EFCore.
After migration to 5.0 there is error:

System.TypeLoadException: Method 'ProcessForeignKeyOwnershipChanged' in type 'EFCore.NamingConventions.Internal.UpperCaseNameRewriter' from assembly 'EFCore.NamingConventions, Version=1.1.0.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7' does not have an implementation.

To be honest, I am not sure if is that strictly related to npgsql , but is there maybe anyone how has the same problem?

Adrian Ksiezarczyk
@adrianksiezarczyk
Ok, actually, I have upgraded this package to 5.0.0-rc1 EFCore.NamingConventions and it started working. I leave these comments in case of someone's similar problem :)
Yoh Deadfall
@YohDeadfall
Yes, the package should be shipped in one week or so. For now using rc is fine.
Kot
@kotx
Hey, I'm using Npgsql.NodaTime and Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime and with optionsBuilder.UseNpgsql(o => o.UseNodaTime()); in my DbContext's OnConfiguring.
I am storing an Instant as a timestamp, but when I try to Update-Database it errors out with 42804: column "Timestamp" cannot be cast automatically to type timestamp without time zone. I don't quite understand why, is NodaTime not properly registering converters?
Side note, should I add NpgsqlConnection.GlobalTypeMapper.UseNodaTime() to OnConfiguring? It doesn't make any difference when I run Update-Database though.
Using ASP.NET Core 5 BTW.
I have been using DateTime (UTC) before changing it to NodaTime's Instant, that might be affecting my migration. Any pointers?
Weston
@ronnyek
does npgsql support ltree types yet? I know it was a thing where both postgres itself and npgsql needed support for binary types or something like that
looks like it was at least int he works, just couldnt tell if it should actually just be there with appropriate versions or not
Yoh Deadfall
@YohDeadfall
@ronnyek, the driver supports ltree starting 5.0.
Weston
@ronnyek
so I should be able to just have a Ltree type property and the ngpsql efcore driver will just work ?
Yoh Deadfall
@YohDeadfall
Probably, am not an EF user, but the driver used under the hood (just Npgsql) passes a string as any of ltree types if the type is specified by its name or NpgsqlDbType.
Therefore, I think it should be fine to provide the required type to EF to make it work (:
Weston
@ronnyek
I'll play with it