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
127 stars 32 forks source link

2 arguments with ctx.query #123

Closed agavrel closed 4 years ago

agavrel commented 4 years ago

Trying the example from the documentation:

await connection.transaction((ctx) async {
        var result = await ctx.query("SELECT id FROM table");
        await ctx.query("INSERT INTO table (id) VALUES (@a:int4)", {
            "a" : result.last[0] + 1
        });
    });

too many argument, only 1 expected but 2 found

Perhaps you could amend the documentation with a working example ?

isoos commented 4 years ago

@agavrel: great catch, this should be fixed easily, alongside with the reference of the 2.0 dev branch.

agavrel commented 4 years ago

No worries, thank you for your hardwork!