postgresql

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

+marmot:name=PostgreSQL +marmot:description=This plugin discovers databases and tables from PostgreSQL instances. +marmot:status=experimental

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	plugin.BaseConfig `json:",inline"`

	// Connection configuration
	Host     string `json:"host" description:"PostgreSQL server hostname or IP address"`
	Port     int    `json:"port" description:"PostgreSQL server port (default: 5432)"`
	User     string `json:"user" description:"Username for authentication"`
	Password string `json:"password" description:"Password for authentication" sensitive:"true"`
	SSLMode  string `json:"ssl_mode" description:"SSL mode (disable, require, verify-ca, verify-full)"`

	// Discovery configuration
	IncludeDatabases     bool           `json:"include_databases" description:"Whether to discover databases" default:"true"`
	IncludeColumns       bool           `json:"include_columns" description:"Whether to include column information in table metadata" default:"true"`
	EnableMetrics        bool           `json:"enable_metrics" description:"Whether to include table metrics" default:"true"`
	DiscoverForeignKeys  bool           `json:"discover_foreign_keys" description:"Whether to discover foreign key relationships" default:"true"`
	SchemaFilter         *plugin.Filter `json:"schema_filter,omitempty" description:"Filter configuration for schemas"`
	TableFilter          *plugin.Filter `json:"table_filter,omitempty" description:"Filter configuration for tables"`
	DatabaseFilter       *plugin.Filter `json:"database_filter,omitempty" description:"Filter configuration for databases"`
	ExcludeSystemSchemas bool           `json:"exclude_system_schemas" description:"Whether to exclude system schemas (pg_*)" default:"true"`
}

Config for PostgreSQL plugin +marmot:config

type PostgresColumnFields

type PostgresColumnFields struct {
	ColumnName    string `json:"column_name" metadata:"column_name" description:"Column name"`
	DataType      string `json:"data_type" metadata:"data_type" description:"Data type"`
	IsNullable    bool   `json:"is_nullable" metadata:"is_nullable" description:"Whether null values are allowed"`
	ColumnDefault string `json:"column_default" metadata:"column_default" description:"Default value expression"`
	IsPrimaryKey  bool   `json:"is_primary_key" metadata:"is_primary_key" description:"Whether column is part of primary key"`
	Comment       string `json:"comment" metadata:"comment" description:"Column comment/description"`
}

PostgresColumnFields represents PostgreSQL column-specific metadata fields +marmot:metadata

type PostgresFields

type PostgresFields struct {
	Host             string `json:"host" metadata:"host" description:"PostgreSQL server hostname"`
	Port             int    `json:"port" metadata:"port" description:"PostgreSQL server port"`
	Database         string `json:"database" metadata:"database" description:"Database name"`
	Schema           string `json:"schema" metadata:"schema" description:"Schema name"`
	TableName        string `json:"table_name" metadata:"table_name" description:"Object name"`
	ObjectType       string `json:"object_type" metadata:"object_type" description:"Object type (table, view, materialized_view)"`
	Owner            string `json:"owner" metadata:"owner" description:"Object owner"`
	Size             int64  `json:"size" metadata:"size" description:"Object size in bytes"`
	RowCount         int64  `json:"row_count" metadata:"row_count" description:"Approximate row count"`
	Created          string `json:"created" metadata:"created" description:"Creation timestamp"`
	Comment          string `json:"comment" metadata:"comment" description:"Object comment/description"`
	Encoding         string `json:"encoding" metadata:"encoding" description:"Database encoding"`
	Collate          string `json:"collate" metadata:"collate" description:"Database collation"`
	CType            string `json:"ctype" metadata:"ctype" description:"Database character classification"`
	IsTemplate       bool   `json:"is_template" metadata:"is_template" description:"Whether database is a template"`
	AllowConnections bool   `json:"allow_connections" metadata:"allow_connections" description:"Whether connections to this database are allowed"`
	ConnectionLimit  int    `json:"connection_limit" metadata:"connection_limit" description:"Maximum allowed connections"`
}

PostgresFields represents PostgreSQL-specific metadata fields +marmot:metadata

type PostgresForeignKeyFields

type PostgresForeignKeyFields struct {
	ConstraintName string `json:"constraint_name" metadata:"constraint_name" description:"Foreign key constraint name"`
	SourceSchema   string `json:"source_schema" metadata:"source_schema" description:"Schema of the referencing table"`
	SourceTable    string `json:"source_table" metadata:"source_table" description:"Name of the referencing table"`
	SourceColumn   string `json:"source_column" metadata:"source_column" description:"Column in the referencing table"`
	TargetSchema   string `json:"target_schema" metadata:"target_schema" description:"Schema of the referenced table"`
	TargetTable    string `json:"target_table" metadata:"target_table" description:"Name of the referenced table"`
	TargetColumn   string `json:"target_column" metadata:"target_column" description:"Column in the referenced table"`
}

PostgresForeignKeyFields represents PostgreSQL foreign key relationship fields +marmot:metadata

type Source

type Source struct {
	// contains filtered or unexported fields
}

Source represents the PostgreSQL plugin

func (*Source) Discover

func (s *Source) Discover(ctx context.Context, pluginConfig plugin.RawPluginConfig) (*plugin.DiscoveryResult, error)

func (*Source) Validate

func (s *Source) Validate(rawConfig plugin.RawPluginConfig) (plugin.RawPluginConfig, error)

Jump to

Keyboard shortcuts

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