generated from alecodes/base-template
42 lines
544 B
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)
|
|
}
|