Documentation ¶
Overview ¶
Package psql contains generic psql methods to be eventually reused
Index ¶
Constants ¶
View Source
const ( // Environment represents Environment parameter Environment = "Environment" // Host represents Host parameter Host = "Host" // User represents User parameter User = "User" // DBName represents DbName parameter DBName = "DbName" // SSLMode represents SSLMode parameter SSLMode = "SSLMode" // DriverName represents DriverName parameter DriverName = "DriverName" // Query represents Query parameter Query = "query" // TableContent represents TableContent parameter TableContent = "tableContent" )
View Source
const CONNECTIONSTRING = "host=%s user=%s dbname=%s sslmode=%s"
CONNECTIONSTRING represents the default psql string to be filled
View Source
const (
// ErrEmptyParameter is used when a required parameter is empty
ErrEmptyParameter = "EmptyParameter"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PSQL ¶
PSQL embeds connection to psql database
func New ¶
func New(cfg *configuration.Configuration) (*PSQL, error)
New returns a new *PSQL initialized with the configuration
func (*PSQL) CreateTable ¶
CreateTable creates a table given a query containing the SQL syntax to create a table. E.g. : `CREATE TABLE example (someKey text PRIMARY KEY, someField text)`
func (*PSQL) InsertInto ¶
InsertInto inserts a row into a table
Click to show internal directories.
Click to hide internal directories.