stablekernel / postgresql-dart

Dart PostgreSQL driver: supports extended query format, binary protocol and statement reuse.
https://www.dartdocs.org/documentation/postgres/latest
BSD 3-Clause "New" or "Revised" License
129 stars 32 forks source link

Substitute value error #168

Open Iskren1990 opened 2 years ago

Iskren1990 commented 2 years ago

Use case

await connection.transaction((ctx) async { await ctx.query("INSERT INTO table (message) VALUES (server@localhost:5432/ep)"); });

Should be valid. Instead it throws substitute value error, while we do not need substitution. Suggestion, in case no substitution values are provided use the provided string.

zambetpentru commented 2 years ago

Hey @Iskren1990

If I'm understanding when you quote the text string does it work?

await connection.transaction((ctx) async { await ctx.query("INSERT INTO table (message) VALUES ('server@localhost:5432/ep')"); });