Golang example #401
Replies: 3 comments
-
An example of just loading the extension? Or an example of actually doing sync / something more involved? I haven't coded in Go but this looks correct in terms of just getting the extension loaded and running: https://chat.openai.com/share/8ecef3c4-647e-4131-a636-3fa54c1ca1c5 In terms of doing sync, the API is exposed over SQL so the sync examples should apply without changes in any language. |
Beta Was this translation helpful? Give feedback.
-
Here is a better Go example: package main
import (
"database/sql"
"fmt"
sqlite3 "github.com/mattn/go-sqlite3"
)
func main() {
sql.Register("sqlite3ext",
&sqlite3.SQLiteDriver{
Extensions: []string{
"path/to/crsqlite",
},
})
db, err := sql.Open("sqlite3ext", ":memory:")
db.Query("select crsql_site_id()")
db.Close()
} You can load multiple extensions this way, just list them in the Note that we use the same identifier |
Beta Was this translation helpful? Give feedback.
-
helpful : https://antonz.org/install-sqlite-extension/#install-go |
Beta Was this translation helpful? Give feedback.
-
https://vlcn.io/docs/cr-sqlite/installation Shows examples which is great .
is there a golang example floating around yet ?
Am thinking that Integration with Pocketbaae golang project is a great example as it is heavily invested in SQLite and highly popular.
https://github.com/pocketbase/pocketbase
it does real time using SSE networking . But crdt will provide scaleout for the server and offline for the client. Client is web based .
fly.io is already experimenting with its server shakeout aspects . The have LiteFS which is a WAL federation and sync system. But they are taking it further with crdt.
Beta Was this translation helpful? Give feedback.
All reactions