From 2cd93c967755cfafc3d54227c28b108fabe64b68 Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Sat, 28 May 2022 23:24:03 +0900 Subject: [PATCH] retab --- _example/json/main.go | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/_example/json/main.go b/_example/json/main.go index 85ade51..9141618 100644 --- a/_example/json/main.go +++ b/_example/json/main.go @@ -42,10 +42,10 @@ func main() { log.Fatal(err) } stmt, err := tx.Prepare(` - insert into iris( - sepal_length, sepal_width, petal_length, petal_width, class) - values(?, ?, ?, ?, ?) - `) + insert into iris( + sepal_length, sepal_width, petal_length, petal_width, class) + values(?, ?, ?, ?, ?) + `) if err != nil { log.Fatal(err) } @@ -82,15 +82,14 @@ func main() { tx.Commit() rows, err := db.Query(`select - json_object( - 'sepal_length', sepal_length, - 'sepal_width', sepal_width, - 'petal_length', petal_length, - 'petal_width', petal_width, - 'class', class - ) - from iris - `) + json_object( + 'sepal_length', sepal_length, + 'sepal_width', sepal_width, + 'petal_length', petal_length, + 'petal_width', petal_width, + 'class', class + ) from iris + `) if err != nil { log.Fatal(err) }