This repository has been archived on 2025-05-15. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
synchronizator-go/examples/usage.go

42 lines
544 B
Go

package main
import (
"database/sql"
"fmt"
synchronizator "git.alecodes.page/alecodes/synchronizator/pkg"
_ "modernc.org/sqlite"
)
type Collection struct {
name string
}
func main() {
connection, err := sql.Open("sqlite", "db.sql")
if err != nil {
fmt.Println(err)
return
}
defer connection.Close()
sync, err := synchronizator.New(connection)
if err != nil {
fmt.Println(err)
return
}
sync, err := sync.NewNode(Collection{name: "foo"})
if err != nil {
fmt.Println(err)
return
}
fmt.Printf("%v", sync)
}