From 1393cf6c9ca959cb110fde16773b25ca83eda9c1 Mon Sep 17 00:00:00 2001 From: agavrel Date: Fri, 5 Jun 2020 01:09:25 +0200 Subject: [PATCH] [DOC] Added documentation to retrieve bytearray --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index f717a96..ef05307 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,23 @@ await connection.transaction((ctx) async { }); ``` +Execute query to retrieve ByteArray type: + +```dart +import 'dart:typed_data'; // required for Uint8List + +Future> GetByteArray(final int Id) async { + var connection = new PostgreSQLConnection(...); // replace with your credentials + await connection.open(); + var sqlQuery = "SELECT data FROM table WHERE id = @Id"; + List results = await connection.query(sqlQuery, substitutionValues: { + "Id" : id + }); + + return results; +} +``` + See the API documentation: https://www.dartdocs.org/documentation/postgres/latest. ## Development branch