Skip to content

Commit 02e1c55

Browse files
committed
Add go install
1 parent 51ac27d commit 02e1c55

File tree

6 files changed

+19
-11
lines changed

6 files changed

+19
-11
lines changed

.github/workflows/chdb.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Test
2626
run: make test
2727
- name: Test main
28-
run: LD_LIBRARY_PATH=./ ./chdb-go "SELECT 12345"
28+
run: ./chdb-go "SELECT 12345"
2929

3030
build_mac:
3131
runs-on: macos-12

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
go mod tidy
2222
make build
2323
- name: Test
24-
run: LD_LIBRARY_PATH=. ./chdb-go "SELECT 12345"
24+
run: ./chdb-go "SELECT 12345"
2525
- name: Get Version
2626
run: |
2727
echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ update_libchdb:
44
./update_libchdb.sh
55

66
install:
7-
curl -sL https://lib.chdb.io | sudo bash
7+
curl -sL https://lib.chdb.io | bash
88

99
test:
1010
CGO_ENABLED=1 go test -v -coverprofile=coverage.out ./...
@@ -13,4 +13,4 @@ run:
1313
CGO_ENABLED=1 go run main.go
1414

1515
build:
16-
CGO_ENABLED=1 go build -o chdb-go main.go
16+
CGO_ENABLED=1 go build -ldflags '-extldflags "-Wl,-rpath,/usr/local/lib"' -o chdb-go main.go

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,20 @@
99

1010
## Install
1111

12-
1. Download and install [`libchdb`](https://github.com/chdb-io/chdb/releases)
13-
- run `make update_libchdb` to download and extract libchdb.so. or
14-
- run `make install` to install libchdb.so
15-
2. Build `chdb-go`
12+
### Install libchdb.so
13+
1. Install [`libchdb`](https://github.com/chdb-io/chdb/releases)
14+
- curl -sL https://lib.chdb.io | bash
15+
16+
### Install chdb-go
17+
1. Install `chdb-go`
18+
- `go install github.com/chdb-io/chdb-go@latest`
19+
2. Run `chdb-go` with or without persistent `--path`
20+
- run `$GOPATH/bin/chdb-go`
21+
22+
### or Build from source
23+
1. Build `chdb-go`
1624
- run `make build`
17-
3. Run `chdb-go` with or without persistent `--path`
25+
2. Run `chdb-go` with or without persistent `--path`
1826
- run `./chdb-go`
1927

2028
## chdb-go CLI

chdbstable/chdb.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package chdbstable
22

33
/*
4-
#cgo LDFLAGS: -L. -lchdb
4+
#cgo LDFLAGS: -L/usr/local/lib -lchdb
55
#include <stdlib.h> // Include the C standard library for C.free
66
#include "chdb.h"
77
*/

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/chdb-io/chdb-go
22

3-
go 1.21.5
3+
go 1.21
44

55
require (
66
github.com/apache/arrow/go/v14 v14.0.2

0 commit comments

Comments
 (0)