chdb-io / chdb-go Goto Github PK
View Code? Open in Web Editor NEWGo bindings and cli for chDB, an in-process SQL OLAP Engine powered by ClickHouse
Home Page: https://chdb.io
License: Apache License 2.0
Go bindings and cli for chDB, an in-process SQL OLAP Engine powered by ClickHouse
Home Page: https://chdb.io
License: Apache License 2.0
Is it possible to have an option to compile a statically linked Go binary so there's no dependency on having libchdb.so present on the machine it's running on?
My understanding is you need to build a static library libchdb.a file instead of a dynamic library libchdb.so, I tried modifying the chdb build script to see if it was possible and ran into a linker issue which I couldn't get past.
With the following program, I'm not able to query system.parts
.
package main
import (
"fmt"
"github.com/chdb-io/chdb-go/chdb"
)
func main() {
result, err := chdb.Query("SELECT version()", "CSV")
if err != nil {
fmt.Println(err)
return
}
fmt.Println(result)
session, _ := chdb.NewSession("./data")
defer session.Close()
q := `select * from system.parts`
ret, err := session.Query(q)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(ret)
}
This outputs the following:
$ CGO_LDFLAGS="-L." go run .
"23.10.1.1"
Code: 60. DB::Exception: Table system.parts does not exist. (UNKNOWN_TABLE)
I am linking downloaded chdb v1.3.0. It is curious that the version is so old. It seems like system.parts
was added in December 2023 based on these issues:
Is there a way to connect to chdb using clickhouse-go?
Hi,
When creating a database or table, it does not return an error if it already exists, but it prints a debug on the terminal.
the example code:
db, err := chdb.NewSession("a") //path is option
if err != nil {
fmt.Println("hata", err)
return
}
fmt.Print("\nburası\n")
a := db.Query("CREATE DATABASE db")
fmt.Println("a değeri",a)
db.Query("USE db")
the terminal:
burası
Code: 82. DB::Exception: Database db already exists. (DATABASE_ALREADY_EXISTS)
a değeri
Does anyone have any solution suggestions?
Thank you, happy new year
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.