ebuckley / cr-sqlite-go

A simple golang library that exposes the cr-sqlite extension for sqlite
5 stars 2 forks source link

look for shared lib from runtime file location by default #1

Open gedw99 opened 3 months ago

gedw99 commented 3 months ago

In https://github.com/ebuckley/cr-sqlite-go/blob/main/cmd/server/service.go#L13

its hardcoded to the devs own special path.

Suggest we look up the Runtime path and load it form there.

gedw99 commented 3 months ago

This works...

Should also add a makefile to pull the right one form their GitHub and also load the right one at runtime.

´´´go var setup = sync.OnceFunc(func() { ex, err := os.Executable() if err != nil { panic(err) } exPath := filepath.Dir(ex) crsql.Register(filepath.Join(exPath, "crsqlite")) // TODO make configurable })


´´´sh
cr-sqlite-go
2024/05/31 16:20:58 INFO Registered ChangeServiceHandler path=/api.v1.ChangeService/
2024/05/31 16:20:58 INFO Started server on port=50051
gedw99 commented 3 months ago

Please se the PR which does all the above correctly.

https://github.com/ebuckley/cr-sqlite-go/pull/2