42 lines
689 B
Go
42 lines
689 B
Go
|
package clickhouse_test
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"github.com/BlackBroker/trashlog/dal/clickhouse"
|
||
|
. "github.com/onsi/ginkgo"
|
||
|
. "github.com/onsi/gomega"
|
||
|
"github.com/themakers/hlog"
|
||
|
"go.uber.org/zap"
|
||
|
)
|
||
|
|
||
|
var _ = Describe("Clickhouse", func() {
|
||
|
|
||
|
var (
|
||
|
err error
|
||
|
store *clickhouse.DAL
|
||
|
ctx = context.Background()
|
||
|
)
|
||
|
|
||
|
logger, err := zap.NewDevelopment()
|
||
|
|
||
|
log := hlog.New(logger)
|
||
|
|
||
|
Context("Create", func() {
|
||
|
It("Connection", func() {
|
||
|
store, err = clickhouse.New(
|
||
|
ctx,
|
||
|
log,
|
||
|
"tcp://127.0.0.1:9000?debug=true",
|
||
|
)
|
||
|
Expect(store).ToNot(BeNil())
|
||
|
Expect(err).To(BeNil())
|
||
|
})
|
||
|
|
||
|
It("Table", func() {
|
||
|
err := store.Init(ctx)
|
||
|
Expect(err).To(BeNil())
|
||
|
})
|
||
|
})
|
||
|
|
||
|
})
|