zzzprojects / Dapper-Plus

Dapper Plus - High-Efficient Bulk Actions (Insert, Update, Delete, and Merge) for .NET
https://dapper-plus.net/
389 stars 86 forks source link

Postgre CreateTable gives error #149

Open Sharma-Arcadix opened 1 month ago

Sharma-Arcadix commented 1 month ago

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

JonathanMagnan commented 1 month ago

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