Skip to content

Latest commit

 

History

History
36 lines (25 loc) · 491 Bytes

README.md

File metadata and controls

36 lines (25 loc) · 491 Bytes

clickhouse

Clickhouse support for GORM

Quick Start

package main

import (
  "fmt"


  "github.com/sweetpotato0/clickhouse"
  "gorm.io/gorm"
)

// User .
type User struct {
  ID   uint8  `gorm:"column:id"`
  Name string `gorm:"column:name"`
}

func main() {

  db, err := gorm.Open(clickhouse.Open("http://127.0.0.1:8123/default"), &gorm.Config{})
  if err != nil {
    panic(err.Error())
  }

  user := []User{}
  db.Table("user").Find(&user)
  fmt.Printf("%#v\n", user)
}