wip: implementing db initialization

This commit is contained in:
Alexander Navarro 2024-11-13 19:55:02 +00:00
parent ffd3c2014e
commit a5c762ddd2
5 changed files with 183 additions and 0 deletions

42
examples/usage.go Normal file
View file

@ -0,0 +1,42 @@
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)
}