Datasets.Create
func (datasetClient) Create(
ctx context.Context,
kind datasets.DatasetKind,
codeName string,
name string,
fields []datasets.Field,
options ...datasets.DatasetOption,
) (*datasets.Dataset, error)Create a dataset with the given code name, display name, schema kind, and custom fields.
Fields created with field.String, field.Bool, field.Int32, field.Int64, field.Uint64, or field.Float64 can be
marked queryable. Queryable fields cannot be repeated, and a dataset can contain at most two queryable string fields.
Parameters
kind datasets.DatasetKind required The dataset kind.
codeName string required The stable code identifier for the dataset.
name string required The display name of the dataset.
fields []datasets.Field required The custom fields in the dataset schema.
options []datasets.DatasetOption Options for dataset metadata.
Options
datasets.WithSummary(summary string) Set a short dataset summary.
datasets.WithDescription(description string) Set the dataset’s markdown description.
Field options
Queryable() Make the field available for server-side custom field filters. Choose queryable fields before ingesting datapoints.
Dataset kinds
datasets.KindTemporal datasets.DatasetKind A dataset that contains timestamp, ID, and ingestion time fields.
datasets.KindSpatiotemporal datasets.DatasetKind A dataset that contains timestamp, ID, ingestion time, and geometry fields.
Returns
The created dataset object.
See Queryable fields for schema constraints and Filter by custom fields for query syntax.