EntityFramework-Reverse-POCO-Code-First-Generator icon indicating copy to clipboard operation
EntityFramework-Reverse-POCO-Code-First-Generator copied to clipboard

The store type 'bigint' could not be found in the Npgsql provider manifest

Open uyau opened this issue 3 years ago • 7 comments

The same error for "integer" and date "timestamp without time zone" and maybe more, i didn't go further. Why so, if database have this types?

uyau avatar Dec 10 '21 17:12 uyau

Found table with types that allows rewrite the table cofiguration. Bigint will be int8. integer - int4. after replacing HasColumnType() with that types all work fine. https://www.postgresql.org/docs/8.1/datatype.html

uyau avatar Dec 13 '21 07:12 uyau

Thanks @uyau I'll make sure this gets corrected for the next release.

sjh37 avatar Dec 13 '21 09:12 sjh37

also small int goes like "int2" and "timestamp without time zone" just "timestamp". Thats all problem types that I had issue with. 4 types. Maybe there can be some more, but not in my db) Don't have time to sit and test it out)

uyau avatar Dec 13 '21 16:12 uyau

Can you post the PostgresToCSharp C# file here that you modified so I can see what you changed 👍

sjh37 avatar Dec 13 '21 17:12 sjh37

@uyau in your <database>.tt file, approx line 14, do you have your Settings.Database set to PostgreSQL?

Settings.DatabaseType = DatabaseType.PostgreSQL;

sjh37 avatar Dec 13 '21 22:12 sjh37

@sjh37 I had follow your instruction by installing msi into GAC, after I installed pacage EntityFramework6.Npgsql with that comes all other packages needed like Npgqls and EF... Then I set settings in tt: Settings.DatabaseType = DatabaseType.PostgreSQL; Settings.TemplateType = TemplateType.Ef6; Settings.GeneratorType = GeneratorType.Ef6; Settings.GenerateSeparateFiles = true; And adding connection string in my web.config

Aftet I save tt. And try to run application. First errors to fix: In generated "MyDbContext.cs" class I have to change
line - 86 "public bool IsSqlParameterNull(NpgsqlParameter param)" to NpgsqlParameter (or maybe add using npgsql, don't remember) and line 88 "var sqlValue = param.SqlValue;" to param.NpgsqlValue

Then I run application and in first linq I have error with bigint. Next I open every tableConfiguration and in lines like: Property(x => x.Id).HasColumnName(@"Id").HasColumnType("int4").IsRequired() I'm changing "HasColomnType" to int8,int4, int2 and timezone like I sad earlyer. And after that everything works fine for me) That's all steps I did. Nothing more)

uyau avatar Dec 14 '21 06:12 uyau

This solution worked for .net Framework 4.5 and 4.7. Same sequence in both case

uyau avatar Dec 14 '21 09:12 uyau

Aftet I save tt. And try to run application. First errors to fix: In generated "MyDbContext.cs" class I have to change line - 86 "public bool IsSqlParameterNull(NpgsqlParameter param)" to NpgsqlParameter (or maybe add using npgsql, don't remember) and line 88 "var sqlValue = param.SqlValue;" to param.NpgsqlValue

Thank you @uyau. This fixed my error with a brand new solution using EF7 Core and .NET Core for PostgreSQL. Definitely a bug that needs to be fixed.

GFoley83 avatar Mar 08 '23 02:03 GFoley83

This has been released in v3.8.2. Any problems, please let me know.

sjh37 avatar May 08 '23 16:05 sjh37