Skip to content

sweetpotato0/clickhouse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages