Skip to content

Conversation

@makiuchi-d
Copy link
Contributor

In the driver's example, information_schema is duplicated.

It is created in two places.

  1. factory.Resolve()
  2. Catalog in Analyzer in Driver.OpenConnector()

There is no need to create it in the factory.Resolve().

I checked databases using this:

diff --git a/driver/_example/main.go b/driver/_example/main.go
index 34e0580ed..adbc1a249 100644
--- a/driver/_example/main.go
+++ b/driver/_example/main.go
@@ -35,6 +35,14 @@ func main() {
        rows, err := db.Query("SELECT * FROM mytable")
        must(err)
        dump(rows)
+
+       rows, err = db.Query("SHOW DATABASES")
+       must(err)
+       for rows.Next() {
+               var db string
+               must(rows.Scan(&db))
+               fmt.Println("db:", db)
+       }
 }
 
 func must(err error) {

Copy link
Contributor

@max-hoffman max-hoffman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems fine to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants