Documentation ¶
Index ¶
- Variables
- type AlterSeqStmt
- type Inet
- type PostGres
- type RetInsertStmt
- func (stmt RetInsertStmt) Compile(d aspect.Dialect, params *aspect.Parameters) (string, error)
- func (stmt RetInsertStmt) CompileColumns(d aspect.Dialect, params *aspect.Parameters, columns []aspect.ColumnElem) []string
- func (stmt RetInsertStmt) Returning(cs ...aspect.Selectable) RetInsertStmt
- func (stmt RetInsertStmt) String() string
- func (stmt RetInsertStmt) Values(args interface{}) RetInsertStmt
- type Sequence
- type Serial
- type UUID
Constants ¶
This section is empty.
Variables ¶
var GenerateV4 string = `uuid_generate_v4()`
var Now string = `now() at time zone 'utc'`
Now represents the clause needed to return a now timestamp in postgres
Functions ¶
This section is empty.
Types ¶
type AlterSeqStmt ¶
type AlterSeqStmt struct {
// contains filtered or unexported fields
}
func AlterSequence ¶
func AlterSequence(sequence Sequence) (stmt AlterSeqStmt)
func (AlterSeqStmt) Compile ¶
func (stmt AlterSeqStmt) Compile(d aspect.Dialect, ps *aspect.Parameters) (string, error)
func (AlterSeqStmt) RenameTo ¶
func (stmt AlterSeqStmt) RenameTo(name string) AlterSeqStmt
func (AlterSeqStmt) RestartWith ¶
func (stmt AlterSeqStmt) RestartWith(n int) AlterSeqStmt
func (AlterSeqStmt) String ¶
func (stmt AlterSeqStmt) String() string
type Inet ¶
func (Inet) IsPrimaryKey ¶
func (Inet) IsRequired ¶
type PostGres ¶
type PostGres struct{}
Implement the Dialect interface
func (*PostGres) Parameterize ¶
type RetInsertStmt ¶
type RetInsertStmt struct { aspect.InsertStmt // contains filtered or unexported fields }
RetInsertStmt is the internal representation of an INSERT ... RETURNING statement.
func Insert ¶
func Insert(s aspect.Selectable, ss ...aspect.Selectable) RetInsertStmt
Insert creates an INSERT ... RETURNING statement for the given columns. There must be at least one column and all columns must belong to the same table.
func (RetInsertStmt) Compile ¶
func (stmt RetInsertStmt) Compile(d aspect.Dialect, params *aspect.Parameters) (string, error)
Compile outputs the INSERT ... RETURNING statement using the given dialect and parameters. An error may be returned because of a pre-existing error or because an error occurred during compilation.
func (RetInsertStmt) CompileColumns ¶
func (stmt RetInsertStmt) CompileColumns(d aspect.Dialect, params *aspect.Parameters, columns []aspect.ColumnElem) []string
TODO are errors required? TODO This should be a generalized function
func (RetInsertStmt) Returning ¶
func (stmt RetInsertStmt) Returning(cs ...aspect.Selectable) RetInsertStmt
Returning adds a RETURNING clause to the statement.
func (RetInsertStmt) String ¶
func (stmt RetInsertStmt) String() string
String outputs the parameter-less INSERT ... RETURNING statement in a neutral dialect.
func (RetInsertStmt) Values ¶
func (stmt RetInsertStmt) Values(args interface{}) RetInsertStmt
Values proxies to the inner InsertStmt's Values method