Closed konghao8013 closed 8 months ago
This looks like a Npgsql issue, I dont think I can help here.
@roji ?
22P02 is the PostgreSQL error "invalid_text_representation" there seems to be something problematic related to the table name... @konghao8013 can you please open this issue on https://github.com/npgsql/efcore.pg, and include a minimal database schema (preferably a single CREATE TABLE) which, when scaffolded, produces this?
Create a bug report, feature proposal, or ask a question.
NOTICE: A bug report without sufficient technical and repro details and version information WILL BE CLOSED WITHOUT ANY FURTHER ACTION.
Provide steps to reproduce a bug
Please include a complete description of the issue or link to a project that I can run to reproduce the issue.
Provide technical details
EF Core Power Tools version: (found in About dialog - blue questionmark icon on context menu)
Exact Visual Studio version: (e.g. Visual Studio 2022 17.8.3)
Database engine: (Kingbase)
EF Core version in use: (e.g. EF Core 7)
Is Handlebars templates used: no/yes
Is T4 templates used: no/yes
Is a SQL Server .dacpac used: no/yes
{ "CodeGenerationMode": 3, "ContextClassName": "testContext", "ContextNamespace": null, "DefaultDacpacSchema": null, "FilterSchemas": false, "IncludeConnectionString": false, "ModelNamespace": null, "OutputContextPath": null, "OutputPath": "Models", "PreserveCasingWithRegex": true, "ProjectRootNamespace": "EFLibrary", "Schemas": null, "SelectedHandlebarsLanguage": 2, "SelectedToBeGenerated": 0, "T4TemplatePath": null, "Tables": [ { "Name": "public.Tab4", "ObjectType": 0 } ], "UiHint": ".test3", "UncountableWords": null, "UseBoolPropertiesWithoutDefaultSql": true, "UseDatabaseNames": true, "UseDateOnlyTimeOnly": false, "UseDbContextSplitting": false, "UseDecimalDataAnnotationForSprocResult": true, "UseFluentApiOnly": true, "UseHandleBars": false, "UseHierarchyId": false, "UseInflector": false, "UseLegacyPluralizer": false, "UseManyToManyEntity": false, "UseNoDefaultConstructor": false, "UseNoNavigations": false, "UseNoObjectFilter": false, "UseNodaTime": false, "UseNullableReferences": false, "UsePrefixNavigationNaming": false, "UseSchemaFolders": false, "UseSchemaNamespaces": false, "UseSpatial": false, "UseT4": false }
Congratulations, 'EF Core Power Tools' has now generated a DbContext and Entity classes for you.
You need to configure your app now - here are some hints:
ASP.NET Core:
Register your DbContext class in your "Program.cs" file.
Add "ConnectionStrings" to your configuration file (secrets.json, appsettings.Development.json or appsettings.json).
Thank you!
Thank you for using this free tool! Have a look at the wiki to learn more about all the advanced features
You can create issues, questions and suggestions on GitHub
If you like my free tool, I would be very grateful for a rating or review on Visual Studio Marketplace or even a one-time or monthly sponsorship
Some issues were discovered during reverse engineering, consider addressing them:
Npgsql.PostgresException (0x80004005): 22P02: 无效的类型 boolean 输入语法: "public.Tab4"
POSITION: 793 at Npgsql.Internal.NpgsqlConnector.g__ReadMessageLong|233_0(NpgsqlConnector connector, Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage)
at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken)
at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken)
at Npgsql.NpgsqlDataReader.NextResult()
at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken)
at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken)
at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior)
at Npgsql.EntityFrameworkCore.PostgreSQL.Scaffolding.Internal.NpgsqlDatabaseModelFactory.GetTables(NpgsqlConnection connection, DatabaseModel databaseModel, Func
3 tableFilter, String internalSchemas, HashSet
1 enums, IDiagnosticsLogger1 logger) at Npgsql.EntityFrameworkCore.PostgreSQL.Scaffolding.Internal.NpgsqlDatabaseModelFactory.Create(DbConnection dbConnection, DatabaseModelFactoryOptions options) at Npgsql.EntityFrameworkCore.PostgreSQL.Scaffolding.Internal.NpgsqlDatabaseModelFactory.Create(String connectionString, DatabaseModelFactoryOptions options) at RevEng.Core.ReverseEngineerScaffolder.ScaffoldModel(String connectionString, DatabaseModelFactoryOptions databaseOptions, ModelReverseEngineerOptions modelOptions, ModelCodeGenerationOptions codeOptions, Boolean removeNullableBoolDefaults, Boolean excludeNavigations, Boolean dbContextOnly, Boolean entitiesOnly, Boolean useSchemaFolders, Boolean useSchemaNamespaces) in C:\Code\Github\EFCorePowerTools\src\Core\RevEng.Core.60\ReverseEngineerScaffolder.cs:line 460 at RevEng.Core.ReverseEngineerScaffolder.GenerateDbContext(ReverseEngineerCommandOptions options, List
1 schemas, String outputContextDir, String modelNamespace, String contextNamespace, String projectPath, String outputPath) in C:\Code\Github\EFCorePowerTools\src\Core\RevEng.Core.60\ReverseEngineerScaffolder.cs:line 94 at RevEng.Core.ReverseEngineerRunner.GenerateFiles(ReverseEngineerCommandOptions options) in C:\Code\Github\EFCorePowerTools\src\Core\RevEng.Core.60\ReverseEngineerRunner.cs:line 78 Exception data: Severity: 错误 SqlState: 22P02 MessageText: 无效的类型 boolean 输入语法: "public.Tab4" Position: 793 File: kdb_bool.c Line: 309 Routine: boolin