warehouses

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

*

  • Package warehouses provides an abstraction for interacting with different types of databases. *
  • The `Database` interface includes the following methods:
  • - `Bootstrap`: Prepares the database for use, such as setting up initial configurations.
  • - `Prune`: Cleans up old or unnecessary data from the database.
  • - `Upload`: Uploads data to the database in chunks, using a callback function to fetch the next record.
  • - `CreateViews`: Creates database views based on the provided schema. *
  • The `NewDatabase` function is a factory method that returns a `Database` implementation based on the provided configuration.
  • Currently, it supports the following database types:
  • - "SNOWFLAKE": Returns a Snowflake database implementation. *
  • If an unsupported database type is specified, the `New` function returns an error.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database interface {
	Prune() error
	Upload(batch_date string, nextRecord func() (map[string]interface{}, error)) (int, error)
	CreateViews(root execute.RootSchema) error
}

func NewDatabase

func NewDatabase(cfg config.Config) (Database, error)

*

  • NewDatabase creates a new instance of a `Database` implementation based on the provided configuration. *
  • Supported Database Types:
  • - "SNOWFLAKE": Returns a Snowflake database implementation.
  • - "SQLITE": Returns a Snowflake database implementation. *
  • Parameters:
  • - `cfg` (config.Config): The configuration object *
  • Returns:
  • - (Database): A `Database` implementation matching the specified type.
  • - (error): An error if the `DatabaseType` is unsupported or if initialization fails.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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