Skip to main content

Log Tables

The Go SDK currently supports both indexed log writes and Arrow-oriented log flows.

For most readers, the simplest way to understand log tables is:

  • append a row
  • scan or fetch rows back
  • use schema-aware decode helpers

Indexed Row Append​

The dev harness writes an indexed log row like this:

row, err := client.NewRow(
logSchema,
int64(time.Now().UnixNano()%1_000_000),
int64(101),
mustDecimal("19.95", 15, 2),
"created",
)
if err != nil {
log.Fatal(err)
}

result, err := logClient.AppendIndexedRowAuto(ctx, row)
if err != nil {
log.Fatal(err)
}

The Auto form is the preferred helper-first path when bucket routing can be derived from table metadata.

Read Back with Limit Scan​

limitResult, err := logClient.LimitScan(ctx, nil, 0, 5)
if err != nil {
log.Fatal(err)
}

rows, err := client.DecodeIndexedLimitScanRows(logSchema, limitResult)
if err != nil {
log.Fatal(err)
}

Fetch-Based Log Reads​

The lower-level fetch path is also available:

fetched, err := table.FetchLog(ctx, -1, 4096, nil, nil, []client.FetchBucketRequest{{
BucketID: 0,
FetchOffset: 0,
}})

This is especially relevant for Arrow log batches and projection-aware reads.

Current Guidance​

  • Prefer row-oriented helpers first.
  • Use fetch APIs when you need request-level control or Arrow-specific flows.
  • Treat bucket 0 in examples as demo-driven context, not a universal rule for all deployments.