nocodb

package
v0.97.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2026 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package nocodb implements the NocoDB adapter for the database capability.

Index

Constants

View Source
const (
	OpListBases    = "list_bases"
	OpListTables   = "list_tables"
	OpGetTable     = "get_table"
	OpListRecords  = "list_records"
	OpGetRecord    = "get_record"
	OpCreateRecord = "create_record"
	OpUpdateRecord = "update_record"
	OpDeleteRecord = "delete_record"
	OpHealth       = "health"
)

Variables

This section is empty.

Functions

func Register

func Register(app string, svc Service) error

Register registers the nocodb capability with hub and invoker registry. When svc is nil the provider is not configured and registration is skipped.

Types

type Adapter

type Adapter struct {
	// contains filtered or unexported fields
}

Adapter implements Service using the NocoDB provider client.

func (*Adapter) CreateRecord

func (a *Adapter) CreateRecord(ctx context.Context, in CreateRecordInput) (*capability.NocoRecord, error)

CreateRecord creates a record with the given fields.

func (*Adapter) DeleteRecord

func (a *Adapter) DeleteRecord(ctx context.Context, in DeleteRecordInput) error

DeleteRecord deletes a record by ID.

func (*Adapter) GetRecord

func (a *Adapter) GetRecord(ctx context.Context, in GetRecordInput) (*capability.NocoRecord, error)

GetRecord returns a single record.

func (*Adapter) GetTable

func (a *Adapter) GetTable(ctx context.Context, in GetTableInput) (*capability.NocoTable, error)

GetTable returns table metadata including columns.

func (*Adapter) HealthCheck

func (a *Adapter) HealthCheck(ctx context.Context) (bool, error)

HealthCheck reports whether the NocoDB backend is reachable. Provider failures are treated as unhealthy (false, nil), not as invoke errors.

func (*Adapter) ListBases

ListBases returns bases visible to the configured API token (first page).

func (*Adapter) ListRecords

ListRecords returns records for a table.

func (*Adapter) ListTables

ListTables returns tables in a base (first page).

func (*Adapter) UpdateRecord

func (a *Adapter) UpdateRecord(ctx context.Context, in UpdateRecordInput) (*capability.NocoRecord, error)

UpdateRecord updates a record by ID. Numeric IDs are encoded as JSON numbers by the provider.

type CreateRecordInput

type CreateRecordInput struct {
	TableID string
	Fields  map[string]any
}

CreateRecordInput holds parameters for creating a record.

type DeleteRecordInput

type DeleteRecordInput struct {
	TableID  string
	RecordID string
}

DeleteRecordInput holds parameters for deleting a record.

type GetRecordInput

type GetRecordInput struct {
	TableID  string
	RecordID string
}

GetRecordInput holds parameters for fetching a single record.

type GetTableInput

type GetTableInput struct {
	TableID string
}

GetTableInput holds parameters for fetching table metadata.

type ListRecordsInput

type ListRecordsInput struct {
	TableID string
	Limit   int
	Offset  int
	Where   string
	Sort    string
	Fields  string
}

ListRecordsInput holds parameters for listing records.

type ListTablesInput

type ListTablesInput struct {
	BaseID string
}

ListTablesInput holds parameters for listing tables in a base.

type Service

Service defines the NocoDB capability contract. List operations return the first page from NocoDB; use Page for pagination metadata. Record IDs assume the default NocoDB "Id" primary key (numeric or string custom PK).

func New

func New() Service

New creates an Adapter using the default provider client (reads config from YAML). Returns nil when the provider is not configured.

func NewWithClient

func NewWithClient(c client) Service

NewWithClient creates an Adapter with a specific client, useful for testing.

type UpdateRecordInput

type UpdateRecordInput struct {
	TableID  string
	RecordID string
	Fields   map[string]any
}

UpdateRecordInput holds parameters for updating a record.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL