forked from mirror/go-sqlite3
retab
This commit is contained in:
parent
5131ffb8eb
commit
2cd93c9677
|
@ -42,10 +42,10 @@ func main() {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
stmt, err := tx.Prepare(`
|
stmt, err := tx.Prepare(`
|
||||||
insert into iris(
|
insert into iris(
|
||||||
sepal_length, sepal_width, petal_length, petal_width, class)
|
sepal_length, sepal_width, petal_length, petal_width, class)
|
||||||
values(?, ?, ?, ?, ?)
|
values(?, ?, ?, ?, ?)
|
||||||
`)
|
`)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
@ -82,15 +82,14 @@ func main() {
|
||||||
tx.Commit()
|
tx.Commit()
|
||||||
|
|
||||||
rows, err := db.Query(`select
|
rows, err := db.Query(`select
|
||||||
json_object(
|
json_object(
|
||||||
'sepal_length', sepal_length,
|
'sepal_length', sepal_length,
|
||||||
'sepal_width', sepal_width,
|
'sepal_width', sepal_width,
|
||||||
'petal_length', petal_length,
|
'petal_length', petal_length,
|
||||||
'petal_width', petal_width,
|
'petal_width', petal_width,
|
||||||
'class', class
|
'class', class
|
||||||
)
|
) from iris
|
||||||
from iris
|
`)
|
||||||
`)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue