models

package
v0.0.0-...-4b3f104 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdditionalProcessing

type AdditionalProcessing struct {
	GetSchema           *bool    `json:"getSchema,omitempty"`
	GetColumns          *bool    `json:"getColumns,omitempty"`
	GetColumnsForSchema *bool    `json:"getColumnsForSchema,omitempty"`
	GetTables           *bool    `json:"getTables,omitempty"`
	Schema              *string  `json:"schema,omitempty"`
	SchemaNames         []string `json:"schemaNames,omitempty"`
	Table               *string  `json:"table,omitempty"`
	FieldsToRemove      []string `json:"fieldsToRemove,omitempty"`
	ArrayToMap          *struct {
		ArrayName string
		Field     string
	} `json:"arrayToMap,omitempty"`
	OverridePost     *bool `json:"overridePost,omitempty"`
	ConvertDatatypes *bool `json:"convertDatatypes,omitempty"`
	LimitThousand    *bool `json:"limitThousand,omitempty"`
	LimitBy          *int  `json:"limitBy,omitempty"`
}

type BaseFilter

type BaseFilter struct {
	FilterType FilterType  `json:"filterType"`
	FieldType  FieldType   `json:"fieldType"`
	Operator   Operator    `json:"operator"`
	Field      string      `json:"field"`
	Value      interface{} `json:"value"`
	Table      *string     `json:"table,omitempty"`
}

func ConvertCustomFilter

func ConvertCustomFilter(filter Filter) BaseFilter

type BoolOperator

type BoolOperator string
const (
	BOOL_EQUAL_TO     BoolOperator = "equal to"
	BOOL_NOT_EQUAL_TO BoolOperator = "not equal to"
)

type CacheCloudConfig

type CacheCloudConfig struct {
	Type    CacheType
	Default interface{}
}

CacheCloudConfig holds the configuration for cache-related settings.

type CacheCredentials

type CacheCredentials struct {
	Username  string
	Password  string
	Host      string
	Port      string
	CacheType string
	TTL       *time.Duration
}

CacheCredentials holds the credentials and configuration for a cache.

type CacheType

type CacheType struct {
	CacheQueries bool
}

CacheType holds the cache-related boolean settings.

type Client

type Client struct {
	Name                            string
	DatabaseConnectionString        string
	ETLDatabaseConnectionString     string
	StagingDatabaseConnectionString string
	CustomerTableTitleFieldName     string
	DatabaseType                    string
	CustomerFieldName               string
	CustomerTableFieldName          string
	CustomerTableName               string
	CustomerView                    string
	CustomerFieldType               string
	UseSSL                          bool
	ServerCA                        string
	ClientCert                      string
	ClientKey                       string
	DefaultQuery                    string
	IgnoreDarkMode                  bool
	DomainName                      string
	HideSqlEditor                   bool
	AdminCustomerID                 string
	StagingAdminCustomerID          string
	CacheCloudConfig                CacheCloudConfig
}

Client represents the configuration and settings for a database client.

type Column

type Column struct {
	ID     string `json:"_id"`
	Field  string `json:"field"`
	Format string `json:"format"`
	Label  string `json:"label"`
}

type DashboardConfig

type DashboardConfig struct {
	Filters  []DashboardFilter
	Sections map[string][]DashboardItem `json:"sections"`
	Name     string
}

type DashboardFilter

type DashboardFilter struct {
	Table      string
	Field      string
	LabelField string
	Label      string
	FilterType string
	Options    []interface{}
	Query      string
}

type DashboardItem

type DashboardItem struct {
	ID            string       `json:"_id"`
	ChartType     string       `json:"chartType"`
	ClientId      string       `json:"clientId"`
	Columns       []Column     `json:"columns"`
	CreatedAt     string       `json:"createdAt"` // or time.Time if you are going to parse it
	CustomerId    string       `json:"customerId"`
	DashboardName string       `json:"dashboardName"`
	DateField     DateField    `json:"dateField"`
	Name          string       `json:"name"`
	QueryString   string       `json:"queryString"`
	Template      bool         `json:"template"`
	UpdatedAt     string       `json:"updatedAt"` // or time.Time if you are going to parse it
	XAxisField    string       `json:"xAxisField"`
	XAxisFormat   string       `json:"xAxisFormat"`
	XAxisLabel    string       `json:"xAxisLabel"`
	YAxisFields   []YAxisField `json:"yAxisFields"`
	YAxisLabel    string       `json:"yAxisLabel"`
}

type DatabaseCredentials

type DatabaseCredentials struct {
	DatabaseConnectionString        string
	StagingDatabaseConnectionString string
	DatabaseType                    string
}

type DateField

type DateField struct {
	Table string `json:"table,omitempty"`
	Field string `json:"field,omitempty"`
}

type DateOperator

type DateOperator string
const (
	DATE_CUSTOM                   DateOperator = "custom"
	DATE_IN_THE_LAST              DateOperator = "in the last"
	DATE_IN_THE_PREVIOUS          DateOperator = "in the previous"
	DATE_IN_THE_CURRENT           DateOperator = "in the current"
	DATE_EQUAL_TO                 DateOperator = "equal to"
	DATE_NOT_EQUAL_TO             DateOperator = "not equal to"
	DATE_GREATER_THAN             DateOperator = "greater than"
	DATE_LESS_THAN                DateOperator = "less than"
	DATE_GREATER_THAN_OR_EQUAL_TO DateOperator = "greater than or equal to"
	DATE_LESS_THAN_OR_EQUAL_TO    DateOperator = "less than or equal to"
)

type DateRange

type DateRange struct {
	StartDate string `json:"startDate"`
	EndDate   string `json:"endDate"`
}

type DateValue

type DateValue struct {
	Value int      `json:"value"`
	Unit  TimeUnit `json:"unit"`
}

type Field

type Field struct {
	Name       string  `json:"name"`
	FieldType  *string `json:"fieldType"`
	DataTypeID int     `json:"dataTypeID"`
}

type FieldFormat

type FieldFormat string
const (
	WholeNumber      FieldFormat = "whole_number"
	OneDecimalPlace  FieldFormat = "one_decimal_place"
	TwoDecimalPlaces FieldFormat = "two_decimal_places"
	DollarAmount     FieldFormat = "dollar_amount"
	MMMYYYY          FieldFormat = "MMM_yyyy"
	MMMDDYYYY        FieldFormat = "MMM_dd_yyyy"
	MMMDDToMMMDD     FieldFormat = "MMM_dd-MMM_dd"
	MMMDDHHMMAPPM    FieldFormat = "MMM_dd_hh:mm_ap_pm"
	HHAPPM           FieldFormat = "hh_ap_pm"
	Percent          FieldFormat = "percent"
	StringFormat     FieldFormat = "string"
)

type FieldType

type FieldType string
const (
	STRING  FieldType = "string"
	NUMBER  FieldType = "number"
	DATE    FieldType = "date"
	NULL    FieldType = "null"
	CUSTOM  FieldType = "custom"
	BOOLEAN FieldType = "boolean"
)

type Filter

type Filter struct {
	FilterType FilterType  `json:"filterType"`
	Operator   Operator    `json:"operator"`
	Value      interface{} `json:"value"`
	Field      string      `json:"field"`
	Table      string      `json:"table"`
}

type FilterType

type FilterType string
const (
	STRING_FILTER          FilterType = "string-filter"
	DATE_FILTER            FilterType = "date-filter"
	DATE_CUSTOM_FILTER     FilterType = "date-custom-filter"
	DATE_COMPARISON_FILTER FilterType = "date-comparison-filter"
	NUMERIC_FILTER         FilterType = "numeric-filter"
	NULL_FILTER            FilterType = "null-filter"
	STRING_IN_FILTER       FilterType = "string-in-filter"
	BOOLEAN_FILTER         FilterType = "boolean-filter"
)

type FormattedColumn

type FormattedColumn struct {
	Label     string      `json:"label"`
	Field     string      `json:"field,omitempty"`
	ChartType string      `json:"chartype,omitempty"`
	Format    FieldFormat `json:"format,omitempty"`
	FieldType string      `json:"fieldType,omitempty"`
}

type Mapable

type Mapable interface {
	Get(key string) (string, error)
	Set(key string, value string, ttl *time.Duration) (string, error)
}

Mapable is an interface that defines the methods for cache operations.

type NullOperator

type NullOperator string
const (
	IS_NOT_NULL NullOperator = "is not null"
	IS_NULL     NullOperator = "is null"
)

type NumberOperator

type NumberOperator string
const (
	NUMBER_EQUAL_TO                 NumberOperator = "equal to"
	NUMBER_NOT_EQUAL_TO             NumberOperator = "not equal to"
	NUMBER_GREATER_THAN             NumberOperator = "greater than"
	NUMBER_LESS_THAN                NumberOperator = "less than"
	NUMBER_GREATER_THAN_OR_EQUAL_TO NumberOperator = "greater than or equal to"
	NUMBER_LESS_THAN_OR_EQUAL_TO    NumberOperator = "less than or equal to"
)

type Operator

type Operator interface {
	// contains filtered or unexported methods
}

type PgError

type PgError struct {
	Message  string
	Detail   string
	Hint     string
	Position string
}

PgError represents a PostgreSQL error

func (*PgError) Error

func (e *PgError) Error() string

type QueryResult

type QueryResult struct {
	Fields []map[string]interface{} `json:"fields"`
	Rows   []map[string]interface{} `json:"rows"`
}

type QueryResults

type QueryResults struct {
	QueryResults []map[string]interface{} `json:"queryResults"`
	MappedArray  []interface{}            `json:"mappedArray,omitempty"`
	Columns      []Column                 `json:"columns,omitempty"`
}

type QuillClientParams

type QuillClientParams struct {
	PrivateKey               string
	DatabaseConnectionString *string
	DatabaseConfig           interface{}
	DatabaseType             string
	Cache                    *CacheCredentials
	MetadataServerURL        *string
}

type QuillClientResponse

type QuillClientResponse struct {
	Queries        []interface{}         `json:"queries"`
	Metadata       interface{}           `json:"metadata"`
	RunQueryConfig *AdditionalProcessing `json:"runQueryConfig,omitempty"`
	Error          *string               `json:"error,omitempty"`
}

type QuillConfig

type QuillConfig struct {
	PrivateKey string
	DB         *DatabaseCredentials
	Cache      *CacheCredentials
}

type QuillQueryParams

type QuillQueryParams struct {
	OrgId    string
	Metadata QuillRequestMetadata
	Filters  *[]Filter
}

type QuillQueryResult

type QuillQueryResult struct {
	Data    interface{}   `json:"data,omitempty"`
	Status  string        `json:"status"`
	Error   *string       `json:"error,omitempty"`
	Queries *QueryResults `json:"queries,omitempty"`
}

type QuillRequest

type QuillRequest struct {
	OrgID    *string              `json:"orgId"`
	Metadata QuillRequestMetadata `json:"metadata"`
}

type QuillRequestMetadata

type QuillRequestMetadata struct {
	Task                    string                    `json:"task,omitempty"`
	Queries                 *[]string                 `json:"queries,omitempty"`
	PreQueries              *[]string                 `json:"preQueries,omitempty"`
	RunQueryConfig          *AdditionalProcessing     `json:"runQueryConfig,omitempty"`
	Query                   *string                   `json:"query,omitempty"`
	Id                      *string                   `json:"id,omitempty"`
	Filters                 *[]interface{}            `json:"filters,omitempty"`
	Name                    *string                   `json:"name,omitempty"`
	XAxisField              *string                   `json:"xAxisField,omitempty"`
	YAxisFields             *[]FormattedColumn        `json:"yAxisFields,omitempty"`
	XAxisLabel              *string                   `json:"xAxisLabel,omitempty"`
	XAxisFormat             *FieldFormat              `json:"xAxisFormat,omitempty"`
	YAxisLabel              *string                   `json:"yAxisLabel,omitempty"`
	ChartType               *string                   `json:"chartType,omitempty"`
	DashboardName           *string                   `json:"dashboardName,omitempty"`
	Columns                 *[]FormattedColumn        `json:"columns,omitempty"`
	DateField               *DateField                `json:"dateField,omitempty"`
	Template                *bool                     `json:"template,omitempty"`
	ClientId                *string                   `json:"clientId,omitempty"`
	Deleted                 *bool                     `json:"deleted,omitempty"`
	DatabaseType            *string                   `json:"databaseType,omitempty"`
	OrgID                   interface{}               `json:"orgId,omitempty"` // sometimes int, sometimes string
	DashboardItemId         *string                   `json:"dashboardItemId,omitempty"`
	Ast                     map[string]interface{}    `json:"ast,omitempty"`
	PublicKey               *string                   `json:"publicKey,omitempty"`
	Pivot                   *bool                     `json:"pivot,omitempty"`
	UseNewNodeSql           *bool                     `json:"useNewNodeSql,omitempty"`
	UseUpdatedDataGathering *bool                     `json:"useUpdatedDataGathering,omitempty"`
	AdditionalProcessing    map[string]interface{}    `json:"additionalProcessing,omitempty"`
	ReportId                *string                   `json:"reportId,omitempty"`
	Tables                  *[]string                 `json:"tables,omitempty"`
	Table                   *string                   `json:"table,omitempty"`
	RemoveCustomerField     *bool                     `json:"removeCustomerField,omitempty"`
	GetCustomFields         *bool                     `json:"getCustomFields,omitempty"`
	CustomFieldsByTable     *[]map[string]interface{} `json:"customFieldsByTable,omitempty"`
	TemplateReportIds       *[]string                 `json:"templateReportIds,omitempty"`
	ReferencedTables        *[]string                 `json:"referencedTables,omitempty"`
	ReferencedColumns       map[string]interface{}    `json:"referencedColumns,omitempty"`
}

type RedisMapable

type RedisMapable interface {
	Get(key string) (string, error)
	Set(key string, value interface{}, expiration time.Duration) error
}

Mapable interface represents a cache that can get and set values

type Request

type Request struct {
	Body RequestBody
}

type RequestBody

type RequestBody struct {
	Metadata QuillRequestMetadata `json:"metadata"`
}

type Section

type Section struct {
	ID            string       `json:"_id"`
	ChartType     string       `json:"chartType"`
	ClientId      string       `json:"clientId"`
	Columns       []Column     `json:"columns"`
	CreatedAt     string       `json:"createdAt"` // or time.Time if you are going to parse it
	CustomerId    string       `json:"customerId"`
	DashboardName string       `json:"dashboardName"`
	DateField     DateField    `json:"dateField"`
	Name          string       `json:"name"`
	QueryString   string       `json:"queryString"`
	Template      bool         `json:"template"`
	UpdatedAt     string       `json:"updatedAt"` // or time.Time if you are going to parse it
	XAxisField    string       `json:"xAxisField"`
	XAxisFormat   string       `json:"xAxisFormat"`
	XAxisLabel    string       `json:"xAxisLabel"`
	YAxisFields   []YAxisField `json:"yAxisFields"`
	YAxisLabel    string       `json:"yAxisLabel"`
}

type StringOperator

type StringOperator string
const (
	STRING_IS_EXACTLY     StringOperator = "is exactly"
	STRING_IS_NOT_EXACTLY StringOperator = "is not exactly"
	STRING_CONTAINS       StringOperator = "contains"
	STRING_IS             StringOperator = "is"
	STRING_IS_NOT         StringOperator = "is not"
)

type TimeUnit

type TimeUnit string
const (
	YEAR    TimeUnit = "year"
	QUARTER TimeUnit = "quarter"
	MONTH   TimeUnit = "month"
	WEEK    TimeUnit = "week"
	DAY     TimeUnit = "day"
	HOUR    TimeUnit = "hour"
)

type YAxisField

type YAxisField struct {
	ID     string `json:"_id"`
	Field  string `json:"field"`
	Format string `json:"format"`
	Label  string `json:"label"`
}

Jump to

Keyboard shortcuts

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