Documentation
¶
Overview ¶
Package sqlproxy implements the proxy executing read-only queries against the SQL datasources (datasource proxy kind "SQLProxy").
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Proxy ¶
type Proxy struct {
// Config is the SQL proxy configuration of the datasource (driver, host, database...). It is required.
Config *datasourceSQL.Config
// Secret contains the credentials and the TLS config used to reach the database. It must already be decrypted.
// It can be nil.
Secret *v1.SecretSpec
// Name is the name of the datasource, used in the logs.
Name string
// Project is the project of the datasource, used in the logs. Empty for a global datasource.
Project string
// Path is the path of the request, only used in the error messages.
Path string
// Guard verifies every connection made to the database. It is required.
Guard *netguard.Guard
// contains filtered or unexported fields
}
Proxy executes a read-only SQL query against a datasource (datasource proxy kind "SQLProxy"). It must be built with New, once per request to serve.
The query is checked to start with a read statement, then executed in a read-only transaction. Every connection to the database is verified by the Guard.
type SQLColumnMetadata ¶
SQLColumnMetadata represents metadata for a single column in SQL result
type SQLResponse ¶
type SQLResponse struct {
Columns []SQLColumnMetadata `json:"columns"`
Rows []SQLRow `json:"rows"`
}
SQLResponse represents the complete SQL query response
Click to show internal directories.
Click to hide internal directories.