error handling: Query does not return error
Closed this issue · 3 comments
ikrammert commented
Hi,
When creating a database or table, it does not return an error if it already exists, but it prints a debug on the terminal.
the example code:
db, err := chdb.NewSession("a") //path is option
if err != nil {
fmt.Println("hata", err)
return
}
fmt.Print("\nburası\n")
a := db.Query("CREATE DATABASE db")
fmt.Println("a değeri",a)
db.Query("USE db")
the terminal:
burası
Code: 82. DB::Exception: Database db already exists. (DATABASE_ALREADY_EXISTS)
a değeri
Does anyone have any solution suggestions?
Thank you, happy new year
auxten commented
It's a known issue of chdb. See chdb-io/chdb#54
To be fixed in chdb v1.2
auxten commented
C API supported, need adapt chdb-go to API v2
chdb-io/chdb#105
auxten commented