zzzprojects/Dapper-Plus

Postgre CreateTable gives error

Opened this issue · 1 comments

Description

CreateTable gives error with Postgre connection string

Exception

Npgsql.PostgresException: '42601: syntax error at or near "If"

Exception message:
This exception was originally thrown at this call stack:
    Npgsql.Internal.NpgsqlConnector.ReadMessageLong(bool, Npgsql.Internal.DataRowLoadingMode, bool, bool)
    System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder<TResult>.StateMachineBox<TStateMachine>.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(short) in PoolingAsyncValueTaskMethodBuilder.cs
    Npgsql.NpgsqlDataReader.NextResult(bool, bool, System.Threading.CancellationToken)
    Npgsql.NpgsqlDataReader.NextResult(bool, bool, System.Threading.CancellationToken)
    Npgsql.NpgsqlDataReader.NextResult()
    Npgsql.NpgsqlCommand.ExecuteReader(bool, System.Data.CommandBehavior, System.Threading.CancellationToken)
    Npgsql.NpgsqlCommand.ExecuteReader(bool, System.Data.CommandBehavior, System.Threading.CancellationToken)
    System.Threading.Tasks.ValueTask<TResult>.Result.get() in ValueTask.cs
    Npgsql.NpgsqlCommand.ExecuteNonQuery(bool, System.Threading.CancellationToken)
    Npgsql.NpgsqlCommand.ExecuteNonQuery()

Further technical details

  • Dapper version: [Dapper v2.1.4]
  • Dapper Plus version: [Dapper Plus v6.0.5]
  • Database Server version: [Postgre 8.1]
  • Database Provider version (NuGet): [Microsoft.Data.SqlClient v5.1.2]

Hello @Sharma-Arcadix ,

Unfortunately, this feature currently only supports SQL Server.

We might eventually add PostgreSQL and other providers, but there is currently no short-term plan for doing it. It is usually more used, for example, on .NET Fiddle.

Best Regards,

Jon