2023-05-28 19:59:57 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"blackforestbytes.com/simplecloudnotifier/db/schema"
|
|
|
|
"context"
|
|
|
|
"fmt"
|
|
|
|
"github.com/mattn/go-sqlite3"
|
|
|
|
"gogs.mikescher.com/BlackForestBytes/goext/sq"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
|
|
|
defer cancel()
|
|
|
|
|
|
|
|
sqlite3.Version() // ensure slite3 loaded
|
|
|
|
{
|
2023-12-31 15:15:27 +01:00
|
|
|
h0, err := sq.HashSqliteSchema(ctx, schema.PrimarySchema[1].SQL)
|
2023-05-28 19:59:57 +02:00
|
|
|
if err != nil {
|
|
|
|
h0 = "ERR"
|
|
|
|
}
|
|
|
|
fmt.Printf("PrimarySchema1 := %s\n", h0)
|
|
|
|
}
|
|
|
|
{
|
2023-12-31 15:15:27 +01:00
|
|
|
h0, err := sq.HashSqliteSchema(ctx, schema.PrimarySchema[2].SQL)
|
2023-05-28 19:59:57 +02:00
|
|
|
if err != nil {
|
|
|
|
h0 = "ERR"
|
|
|
|
}
|
|
|
|
fmt.Printf("PrimarySchema2 := %s\n", h0)
|
|
|
|
}
|
|
|
|
{
|
2023-12-31 15:15:27 +01:00
|
|
|
h0, err := sq.HashSqliteSchema(ctx, schema.PrimarySchema[3].SQL)
|
2023-05-28 19:59:57 +02:00
|
|
|
if err != nil {
|
|
|
|
h0 = "ERR"
|
|
|
|
}
|
|
|
|
fmt.Printf("PrimarySchema3 := %s\n", h0)
|
|
|
|
}
|
2023-07-27 17:44:06 +02:00
|
|
|
{
|
2023-12-31 15:15:27 +01:00
|
|
|
h0, err := sq.HashSqliteSchema(ctx, schema.PrimarySchema[4].SQL)
|
2023-07-27 17:44:06 +02:00
|
|
|
if err != nil {
|
|
|
|
h0 = "ERR"
|
|
|
|
}
|
|
|
|
fmt.Printf("PrimarySchema4 := %s\n", h0)
|
|
|
|
}
|
2023-05-28 19:59:57 +02:00
|
|
|
{
|
2023-12-31 15:15:27 +01:00
|
|
|
h0, err := sq.HashSqliteSchema(ctx, schema.RequestsSchema[1].SQL)
|
2023-05-28 19:59:57 +02:00
|
|
|
if err != nil {
|
|
|
|
h0 = "ERR"
|
|
|
|
}
|
|
|
|
fmt.Printf("RequestsSchema1 := %s\n", h0)
|
|
|
|
}
|
|
|
|
{
|
2023-12-31 15:15:27 +01:00
|
|
|
h0, err := sq.HashSqliteSchema(ctx, schema.LogsSchema[1].SQL)
|
2023-05-28 19:59:57 +02:00
|
|
|
if err != nil {
|
|
|
|
h0 = "ERR"
|
|
|
|
}
|
|
|
|
fmt.Printf("LogsSchema1 := %s\n", h0)
|
|
|
|
}
|
|
|
|
}
|