Documentation
¶
Index ¶
- type Config
- type Connector
- func (c Connector) Config() connectors.Config
- func (c Connector) Discovery(ctx context.Context) ([]model.Table, error)
- func (c *Connector) GuessColumnType(sqlType string) model.ColumnType
- func (c *Connector) InferQuery(ctx context.Context, query string) ([]model.ColumnSchema, error)
- func (c *Connector) InferResultColumns(ctx context.Context, query string) ([]model.ColumnSchema, error)
- func (c Connector) LoadsColumns(ctx context.Context, tableName string) ([]model.ColumnSchema, error)
- func (c Connector) Ping(ctx context.Context) error
- func (c Connector) Query(ctx context.Context, endpoint model.Endpoint, params map[string]any) ([]map[string]any, error)
- func (c Connector) Sample(ctx context.Context, table model.Table) ([]map[string]any, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Hosts []string `yaml:"hosts"`
Database string `yaml:"database"`
User string `yaml:"user"`
Password string `yaml:"password"`
Port int `yaml:"port"`
TLSFile string `yaml:"tls_file"`
EnableTLS bool `yaml:"enable_tls"`
ConnString string `yaml:"conn_string"` // Connection string in format: postgresql://user:password@host:port/database
Schema string `yaml:"schema"` // Database schema name for table access (format: schema.table_name)
}
func (Config) ExtraPrompt ¶ added in v0.0.8
func (Config) MakeConfig ¶
func (c Config) MakeConfig() (*pgx.ConnConfig, error)
type Connector ¶
type Connector struct {
// contains filtered or unexported fields
}
Connector implements the connectors.Connector interface for PostgreSQL
func (Connector) Config ¶ added in v0.0.8
func (c Connector) Config() connectors.Config
func (*Connector) GuessColumnType ¶
func (c *Connector) GuessColumnType(sqlType string) model.ColumnType
GuessColumnType implements TypeGuesser interface for PostgreSQL
func (*Connector) InferQuery ¶
InferQuery implements the Connector interface
func (*Connector) InferResultColumns ¶
func (c *Connector) InferResultColumns(ctx context.Context, query string) ([]model.ColumnSchema, error)
InferResultColumns returns column information for the given query
func (Connector) LoadsColumns ¶
Click to show internal directories.
Click to hide internal directories.