Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect handling ? placeholder in comments #138

Open
tochka opened this issue Aug 17, 2021 · 0 comments
Open

Incorrect handling ? placeholder in comments #138

tochka opened this issue Aug 17, 2021 · 0 comments

Comments

@tochka
Copy link

tochka commented Aug 17, 2021

Driver count ? symbols in comment text

package main

import (
	"database/sql"
	"log"

	_ "github.com/mailru/go-clickhouse"
)

func main() {
	conn, err := sql.Open("clickhouse", "http://127.0.0.1:8123/default?debug=1")
	if err != nil {
		log.Fatal(err)
	}

	if err := conn.Ping(); err != nil {
		log.Fatal(err)
	}
	_, err = conn.Exec(`
			CREATE TABLE IF NOT EXISTS example (
				field1	String				
			) engine=MergeTree(date,field1,8192)
		`)
	if err != nil {
		log.Fatal(err)
	}

	_, err = conn.QueryContext(context.Background(),`
			-- Is it the correct query?
			select * from example
	`)
	if err != nil {
		log.Fatal(err)
	}
}

But I catch dbr: wrong placeholder count error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant