From f1f720cc78da5391bfd727e85fc6fab2728abdd6 Mon Sep 17 00:00:00 2001 From: joe-conigliaro Date: Thu, 26 Sep 2019 21:23:29 +1000 Subject: [PATCH] pg: update optional return syntax --- vlib/pg/pg.v | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vlib/pg/pg.v b/vlib/pg/pg.v index d8a68b8b58..acfe55fdc8 100644 --- a/vlib/pg/pg.v +++ b/vlib/pg/pg.v @@ -103,14 +103,14 @@ pub fn (db DB) exec(query string) []pg.Row { return res_to_rows(res) } -fn rows_first_or_empty(rows []pg.Row) pg.Row? { +fn rows_first_or_empty(rows []pg.Row) ?pg.Row { if rows.len == 0 { return error('no row') } return rows[0] } -pub fn (db DB) exec_one(query string) pg.Row? { +pub fn (db DB) exec_one(query string) ?pg.Row { res := C.PQexec(db.conn, query.str) e := string(C.PQerrorMessage(db.conn)) if e != '' {