Documentation ¶
Overview ¶
Package postgres implements the Dialect for PostgreSQL databases, supporting PostgreSQL 8.0+ corresponding databases.
Index ¶
Constants ¶
const WriteModeCopyIn = "copyIn"
WriteModeCopyIn represents the copy in write mode.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { URL string `json:"url"` // Database URL, including the database address and other database parameters Username string `json:"username"` // Username Password string `json:"password"` // Password }
Config is the PostgreSQL configuration
type CopyInParam ¶
CopyInParam represents the parameters for the copy in operation.
func NewCopyInParam ¶
func NewCopyInParam(t database.Table, txOpts *sql.TxOptions) *CopyInParam
NewCopyInParam creates copy-in parameters based on the table and transaction options (txOps).
type Dialect ¶
type Dialect struct{}
Dialect represents the database dialect for PostgreSQL
type Field ¶
type Field struct { *database.BaseField database.BaseConfigSetter }
Field - Represents a field in a database table.
type FieldType ¶
type FieldType struct { *database.BaseFieldType // contains filtered or unexported fields }
FieldType - Represents the type of a field.
func NewFieldType ¶
func NewFieldType(typ database.ColumnType) *FieldType
NewFieldType - Creates a new field type.
func (*FieldType) IsSupported ¶ added in v0.1.8
IsSupported - Indicates whether parsing is supported for a specific type.
type Scanner ¶
type Scanner struct { database.BaseScanner // contains filtered or unexported fields }
Scanner - A scanner used for reading data based on the column type.
func NewScanner ¶
NewScanner - Generates a scanner based on the column type.
type Source ¶
type Source struct { *database.BaseSource // Basic data source // contains filtered or unexported fields }
Source postgres refers to the PostgreSQL data source
func (*Source) ConnectName ¶
ConnectName is the connection information for the PostgreSQL data source using github.com/Breeze0806/go/database/pqto
func (*Source) DriverName ¶
DriverName is the driver name for github.com/Breeze0806/go/database/pqto
type Table ¶
type Table struct { *database.BaseTable database.BaseConfigSetter }
Table represents a PostgreSQL table.
func NewTable ¶
NewTable creates a new PostgreSQL table. Note that at this point, the schema parameter in BaseTable refers to the schema name, instance is the database name, and name is the table name.
func (*Table) ExecParam ¶
ExecParam retrieves execution parameters, where the copy in parameter mode has been registered.
func (*Table) ShouldOneByOne ¶
ShouldOneByOne specifies whether to retry one operation at a time.
func (*Table) ShouldRetry ¶
ShouldRetry determines whether a retry is necessary.