go:embed test-db.ddl var testSchema []byte func TestIntrospection1(t *testing.T) { ds, err := qcode.ParseSchema(testSchema) if err != nil { t.Fatal(err) } dbinfo := sdata.NewDBInfo(ds.Type, ds.Version, ds.Schema, "", ds.Columns, ds.Functions, nil) aliases := map[string][]string{
(t *testing.T)
| 44 | // } |
| 45 | |
| 46 | func TestIntrospection(t *testing.T) { |
| 47 | |
| 48 | dir, err := os.MkdirTemp("", "test") |
| 49 | if err != nil { |
| 50 | panic(err) |
| 51 | } |
| 52 | defer os.RemoveAll(dir) //nolint:errcheck |
| 53 | fs := core.NewOsFS(dir) |
| 54 | |
| 55 | conf := newConfig(&core.Config{DBType: dbType, EnableIntrospection: true}) |
| 56 | gj, err := core.NewGraphJin(conf, db, core.OptionSetFS(fs)) |
| 57 | if err != nil { |
| 58 | panic(err) |
| 59 | } |
| 60 | defer gj.Close() |
| 61 | b, err := fs.Get("intro.json") |
| 62 | assert.NoError(t, err) |
| 63 | assert.NotEmpty(t, b) |
| 64 | } |