Operations on connections
- GetNamespaces - Get all namespaces
- GetSchema - Get schema for table
- GetTables - Get all tables
Get all namespaces
package main
import(
"context"
"log"
"github.com/fabra-io/go-sdk"
"github.com/fabra-io/go-sdk/pkg/models/operations"
)
func main() {
s := fabra.New(
fabra.WithSecurity(shared.Security{
APIKeyAuth: "YOUR_API_KEY_HERE",
}),
)
ctx := context.Background()
res, err := s.Connection.GetNamespaces(ctx, 592845)
if err != nil {
log.Fatal(err)
}
if res.Namespaces != nil {
// handle response
}
}
Get schema for table
package main
import(
"context"
"log"
"github.com/fabra-io/go-sdk"
"github.com/fabra-io/go-sdk/pkg/models/operations"
)
func main() {
s := fabra.New(
fabra.WithSecurity(shared.Security{
APIKeyAuth: "YOUR_API_KEY_HERE",
}),
)
ctx := context.Background()
res, err := s.Connection.GetSchema(ctx, 715190, "quibusdam", "unde")
if err != nil {
log.Fatal(err)
}
if res.GetSchema200ApplicationJSONObject != nil {
// handle response
}
}
Get all tables
package main
import(
"context"
"log"
"github.com/fabra-io/go-sdk"
"github.com/fabra-io/go-sdk/pkg/models/operations"
)
func main() {
s := fabra.New(
fabra.WithSecurity(shared.Security{
APIKeyAuth: "YOUR_API_KEY_HERE",
}),
)
ctx := context.Background()
res, err := s.Connection.GetTables(ctx, 857946, "corrupti")
if err != nil {
log.Fatal(err)
}
if res.GetTables200ApplicationJSONObject != nil {
// handle response
}
}