MCPcopy Create free account
hub / github.com/crossjoin-io/crossjoin / StoreDataset

Method StoreDataset

api/datasets.go:23–35  ·  view source on GitHub ↗
(hash string, dataset config.Dataset)

Source from the content-addressed store, hash-verified

21)
22
23func (api *API) StoreDataset(hash string, dataset config.Dataset) error {
24 marshaledDatset, err := yaml.Marshal(dataset)
25 if err != nil {
26 return err
27 }
28 _, err = api.db.Exec("REPLACE INTO datasets (config_hash, id, text) VALUES ($1, $2, $3)",
29 hash, dataset.ID, marshaledDatset,
30 )
31 if err != nil {
32 return err
33 }
34 return err
35}
36
37func (api *API) ReadDatasets() ([]config.Dataset, error) {
38 hash, err := api.LatestConfigHash()

Callers 1

LoadConfigMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected