data

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: MIT Imports: 4 Imported by: 0

README

togo

data

part of the togo-framework — the full-stack Go + React framework

togo's data capability — a uniform Query interface over a pluggable source. The built-in pg backend queries the app's Postgres (the db superpowers image), so pg_analytics (OLAP) and pg_search (BM25) come for free — no separate engine. Federation backends query external sources:

Backend Repo
pg (default) built in
BigQuery togo-framework/data-bigquery
Databricks SQL togo-framework/data-databricks
Apache Iceberg togo-framework/data-iceberg
togo install togo-framework/data-bigquery
togo provider:use data bigquery
d := data.FromKernel(k)
rows, _ := d.Query(ctx, "SELECT count(*) AS n FROM orders")

When to reach past pg: only when data must out-scale, out-live, or be shared beyond a single Postgres — see the db notes. Most apps stay on pg.

MIT © fadymondy

Documentation

Overview

Package data is togo's data capability — a uniform Query interface over a pluggable source. The built-in `pg` backend queries the app's Postgres (the togo-framework/db superpowers image: pg_analytics for OLAP + pg_search for BM25 come for free, since they're just SQL against the same database). Federation backends query external sources:

data-bigquery    Google BigQuery
data-databricks  Databricks SQL
data-iceberg     Apache Iceberg (open tables on object storage)

Select one with `togo provider:use data <name>` (or TOGO_DATA_PROVIDER). This repo is the MAIN plugin (contract + the `pg` default).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data interface {
	Query(ctx context.Context, query string, args ...any) ([]Row, error)
}

Data runs a read query against the active source and returns rows.

func FromKernel

func FromKernel(k *togo.Kernel) Data

FromKernel returns the active Data backend (or nil if none registered).

type Row

type Row = map[string]any

Row is one result row (column name → value).

Jump to

Keyboard shortcuts

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