Documentation ¶
Index ¶
- func AddRootCertToConfig(config *pgconn.Config, certLocation string) error
- func CollectOneToStructByName[T any](rows *sql.Rows) (*T, error)
- func CollectToStructByName[T any](rows *sql.Rows) ([]T, error)
- func GetCommentsQueryForPlugin(connectionName string, p map[string]*proto.TableSchema) string
- func GetDeleteConnectionQuery(name string) string
- func GetUpdateConnectionQuery(connectionName, pluginSchemaName string) string
- func IsSchemaNameValid(name string) (bool, string)
- func MaxDbConnections() int
- func PgEscapeName(name string) string
- func PgEscapeSearchPath(searchPath []string) []string
- func PgEscapeString(str string) string
- type ColumnSchema
- type ExecContext
- type InitResult
- type QueryWithArgs
- type SQLFunction
- type SchemaMetadata
- type TableSchema
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddRootCertToConfig ¶
func GetCommentsQueryForPlugin ¶
func GetCommentsQueryForPlugin(connectionName string, p map[string]*proto.TableSchema) string
func IsSchemaNameValid ¶
IsSchemaNameValid verifies that the given string is a valid pgsql schema name
func MaxDbConnections ¶
func MaxDbConnections() int
func PgEscapeName ¶
PgEscapeName escapes strings which will be usaed for Podsdtgres object identifiers (table names, column names, schema names)
func PgEscapeSearchPath ¶
PgEscapeSearchPath applies postgres escaping to search path and remove whitespace
func PgEscapeString ¶
PgEscapeString escapes strings which are to be inserted use a custom escape tag to avoid chance of clash with the escaped text https://medium.com/@lnishada/postgres-dollar-quoting-6d23e4f186ec
Types ¶
type ColumnSchema ¶
type ColumnSchema struct { ID string Name string NotNull bool Type string Default string Description string }
ColumnSchema contains the details of a single column in a table
type ExecContext ¶
type InitResult ¶
type InitResult struct { error_helpers.ErrorAndWarnings Messages []string // allow overriding of the display functions DisplayMessage func(ctx context.Context, m string) DisplayWarning func(ctx context.Context, w string) }
func (*InitResult) AddMessage ¶
func (r *InitResult) AddMessage(messages ...string)
func (*InitResult) AddWarnings ¶
func (r *InitResult) AddWarnings(warnings ...string)
func (*InitResult) DisplayMessages ¶
func (r *InitResult) DisplayMessages()
func (*InitResult) HasMessages ¶
func (r *InitResult) HasMessages() bool
func (*InitResult) Merge ¶
func (r *InitResult) Merge(other InitResult)
type QueryWithArgs ¶
type SQLFunction ¶
type SQLFunction struct { Name string Params map[string]string Returns string Body string Language string }
SQLFunction is a struct for an sqlFunc
type SchemaMetadata ¶
type SchemaMetadata struct { // map {schemaname, {map {tablename -> tableschema}} Schemas map[string]map[string]TableSchema // the name of the temporary schema TemporarySchemaName string }
SchemaMetadata is a struct to represent the schema of the database
func NewSchemaMetadata ¶
func NewSchemaMetadata() *SchemaMetadata
func (*SchemaMetadata) GetSchemas ¶
func (m *SchemaMetadata) GetSchemas() []string
GetSchemas returns all foreign schema names
func (*SchemaMetadata) GetTablesInSchema ¶
func (m *SchemaMetadata) GetTablesInSchema(schemaName string) map[string]struct{}
GetTablesInSchema returns a lookup of all foreign tables in a given foreign schema
type TableSchema ¶
type TableSchema struct { // map columnName -> columnSchema Columns map[string]ColumnSchema Name string FullName string Schema string Description string }
TableSchema contains the details of a single table in the schema