database

package
v0.0.0-...-3c9b827 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package database provides a wrapper of sql.DB for working with the Open Data Link database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColumnSketch

type ColumnSketch struct {
	ColumnID      string
	DatasetID     string
	ColumnName    string
	DistinctCount int
	Minhash       []uint64
	Sample        []string
}

ColumnSketch is a row of the column_sketches table.

type DB

type DB struct {
	*sql.DB
}

DB is a wrapper of the Open Data Link database.

func New

func New(databasePath string) (*DB, error)

New open the database.

func (*DB) ColumnSketch

func (db *DB) ColumnSketch(columnID string) (*ColumnSketch, error)

ColumnSketch returns the ColumnSketch for the given column ID.

func (*DB) DatasetColumns

func (db *DB) DatasetColumns(datasetID string) ([]*ColumnSketch, error)

DatasetColumns returns the column sketches for the dataset with the given ID.

func (*DB) DatasetName

func (db *DB) DatasetName(datasetID string) (string, error)

DatasetName returns the name of a dataset given its ID.

func (*DB) Metadata

func (db *DB) Metadata(datasetID string) (*Metadata, error)

Metadata returns the metadata for the dataset with the given ID.

func (*DB) MetadataVector

func (db *DB) MetadataVector(datasetID string) ([]float32, error)

MetadataVector returns the metadata embedding vector for a dataset.

type Metadata

type Metadata struct {
	DatasetID    string
	Name         string
	Description  string
	Attribution  string
	ContactEmail string
	UpdatedAt    string
	Categories   []string
	Tags         []string
	Permalink    string
}

Metadata is a row of the metadata table.

Jump to

Keyboard shortcuts

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