Skip to content

Commit

Permalink
removed unused in example
Browse files Browse the repository at this point in the history
  • Loading branch information
brennanjl authored and jchappelow committed Jun 4, 2024
1 parent 2710609 commit 3866f97
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions core/client/example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ package main
import (
"context"
"fmt"
"io"
"log"
"math/big"
"slices"
"strings"

"github.com/kwilteam/kwil-db/core/client"
"github.com/kwilteam/kwil-db/core/crypto"
Expand Down Expand Up @@ -96,7 +94,7 @@ func main() {

if !deployed { // need to deploy the "was_here" database
// Use the kuneiform packages to load the schema.
schema, err := unmarshalKf(strings.NewReader(testKf))
schema, err := parse.Parse([]byte(testKf))
if err != nil {
log.Fatal(err)
}
Expand Down Expand Up @@ -227,20 +225,3 @@ action get_all() public view {
SELECT * FROM tags;
}
`

// go:embed test.json
// var testJSON []byte

func unmarshalKf(file io.Reader) (*types.Schema, error) {
source, err := io.ReadAll(file)
if err != nil {
return nil, fmt.Errorf("failed to read Kuneiform source file: %w", err)
}

schema, err := parse.Parse(source)
if err != nil {
return nil, fmt.Errorf("failed to parse file: %w", err)
} // kfSchema := astSchema.(*schema.Schema); j, _ := json.Marshal(kfSchema)

return schema, nil
}

0 comments on commit 3866f97

Please sign in to comment.