Versions in this module Expand all Collapse all v0 v0.8.1 Oct 28, 2022 v0.8.0 Oct 28, 2022 Changes in this version + const CommonTableSQLFragment + const CompoundsSQLFragment + const DeleteBeginSQLFragment + const ForSQLFragment + const FromSQLFragment + const GroupBySQLFragment + const HavingSQLFragment + const InsertBeingSQLFragment + const InsertSQLFragment + const IntoSQLFragment + const JoinSQLFragment + const LimitSQLFragment + const OffsetSQLFragment + const OrderSQLFragment + const OrderWithOffsetFetchSQLFragment + const ReturningSQLFragment + const SelectSQLFragment + const SelectWithLimitSQLFragment + const SourcesSQLFragment + const TruncateSQLFragment + const UpdateBeginSQLFragment + const UpdateFromSQLFragment + const UpdateSQLFragment + const WhereSQLFragment + const WindowSQLFragment + var ErrConflictUpdateValuesRequired = errors.New("values are required for on conflict update expression") + var ErrEmptyCaseWhens = errors.New(`when conditions not found for case statement`) + var ErrEmptyIdentifier = errors.New(...) + var ErrNoSetValuesForUpdate = errors.New("no set values found when generating UPDATE sql") + var ErrNoSourceForDelete = errors.New("no source found when generating delete sql") + var ErrNoSourceForInsert = errors.New("no source found when generating insert sql") + var ErrNoSourceForUpdate = errors.New("no source found when generating update sql") + var ErrNoUpdatedValuesProvided = errors.New("no update values provided") + var ErrNoWindowName = errors.New("window expresion has no valid name") + var ErrUnexpectedNamedWindow = errors.New(`unexpected named window function`) + var FalseLiteral = exp.NewLiteralExpression("FALSE") + var TrueLiteral = exp.NewLiteralExpression("TRUE") + func ErrCTENotSupported(dialect string) error + func ErrDistinctOnNotSupported(dialect string) error + func ErrJoinConditionRequired(j exp.JoinExpression) error + func ErrNotSupportedFragment(sqlType string, f SQLFragmentType) error + func ErrNotSupportedJoinType(j exp.JoinExpression) error + func ErrRecursiveCTENotSupported(dialect string) error + func ErrReturnNotSupported(dialect string) error + func ErrWindowNotSupported(dialect string) error + func GetTimeLocation() *time.Location + func SetTimeLocation(loc *time.Location) + type CommonSQLGenerator interface + Dialect func() string + DialectOptions func() *SQLDialectOptions + ExpressionSQLGenerator func() ExpressionSQLGenerator + FromSQL func(b sb.SQLBuilder, from exp.ColumnListExpression) + LimitSQL func(b sb.SQLBuilder, limit interface{}) + OrderSQL func(b sb.SQLBuilder, order exp.ColumnListExpression) + OrderWithOffsetFetchSQL func(b sb.SQLBuilder, order exp.ColumnListExpression, offset uint, ...) + ReturningSQL func(b sb.SQLBuilder, returns exp.ColumnListExpression) + SourcesSQL func(b sb.SQLBuilder, from exp.ColumnListExpression) + UpdateExpressionSQL func(b sb.SQLBuilder, updates ...exp.UpdateExpression) + WhereSQL func(b sb.SQLBuilder, where exp.ExpressionList) + func NewCommonSQLGenerator(dialect string, do *SQLDialectOptions) CommonSQLGenerator + type DeleteSQLGenerator interface + Dialect func() string + Generate func(b sb.SQLBuilder, clauses exp.DeleteClauses) + func NewDeleteSQLGenerator(dialect string, do *SQLDialectOptions) DeleteSQLGenerator + type ExpressionSQLGenerator interface + Dialect func() string + Generate func(b sb.SQLBuilder, val interface{}) + func NewExpressionSQLGenerator(dialect string, do *SQLDialectOptions) ExpressionSQLGenerator + type InsertSQLGenerator interface + Dialect func() string + Generate func(b sb.SQLBuilder, clauses exp.InsertClauses) + func NewInsertSQLGenerator(dialect string, do *SQLDialectOptions) InsertSQLGenerator + type SQLDialectOptions struct + AndFragment []byte + AsFragment []byte + AscFragment []byte + BitwiseOperatorLookup map[exp.BitwiseOperation][]byte + BooleanDataTypeSupported bool + BooleanOperatorLookup map[exp.BooleanOperation][]byte + CascadeFragment []byte + CaseFragment []byte + CastFragment []byte + CommaRune rune + ConflictDoNothingFragment []byte + ConflictDoUpdateFragment []byte + ConflictFragment []byte + DefaultValuesFragment []byte + DeleteClause []byte + DeleteSQLOrder []SQLFragmentType + DescFragment []byte + DistinctFragment []byte + ElseFragment []byte + EmptyString string + EndFragment []byte + EscapedRunes map[rune][]byte + False []byte + FetchFragment []byte + ForKeyShareFragment []byte + ForNoKeyUpdateFragment []byte + ForShareFragment []byte + ForUpdateFragment []byte + FromFragment []byte + GroupByFragment []byte + HavingFragment []byte + IdentityFragment []byte + IncludePlaceholderNum bool + InsertClause []byte + InsertIgnoreClause []byte + InsertSQLOrder []SQLFragmentType + IntersectAllFragment []byte + IntersectFragment []byte + JoinTypeLookup map[exp.JoinType][]byte + LateralFragment []byte + LeftParenRune rune + LimitFragment []byte + NowaitFragment []byte + Null []byte + NullsFirstFragment []byte + NullsLastFragment []byte + OfFragment []byte + OffsetFragment []byte + OnFragment []byte + OrFragment []byte + OrderByFragment []byte + PeriodRune rune + PlaceHolderFragment []byte + QuoteRune rune + RangeOperatorLookup map[exp.RangeOperation][]byte + RecursiveFragment []byte + RestrictFragment []byte + ReturningFragment []byte + RightParenRune rune + SelectClause []byte + SelectSQLOrder []SQLFragmentType + SetFragment []byte + SetOperatorRune rune + SkipLockedFragment []byte + SpaceRune rune + StarRune rune + StringQuote rune + SupportsConflictTarget bool + SupportsConflictUpdateWhere bool + SupportsDeleteTableHint bool + SupportsDistinctOn bool + SupportsInsertIgnoreSyntax bool + SupportsLateral bool + SupportsLimitOnDelete bool + SupportsLimitOnUpdate bool + SupportsMultipleUpdateTables bool + SupportsOrderByOnDelete bool + SupportsOrderByOnUpdate bool + SupportsReturn bool + SupportsWindowFunction bool + SupportsWithCTE bool + SupportsWithCTERecursive bool + SurroundLimitWithParentheses bool + ThenFragment []byte + TimeFormat string + True []byte + TruncateClause []byte + TruncateSQLOrder []SQLFragmentType + UnionAllFragment []byte + UnionFragment []byte + UpdateClause []byte + UpdateSQLOrder []SQLFragmentType + UseFromClauseForMultipleUpdateTables bool + UseLiteralIsBools bool + UsingFragment []byte + ValuesFragment []byte + WhenFragment []byte + WhereFragment []byte + WindowFragment []byte + WindowOrderByFragment []byte + WindowOverFragment []byte + WindowPartitionByFragment []byte + WithFragment []byte + WrapCompoundsInParens bool + func DefaultDialectOptions() *SQLDialectOptions + type SQLFragmentType int + func (sf SQLFragmentType) String() string + type SelectSQLGenerator interface + Dialect func() string + Generate func(b sb.SQLBuilder, clauses exp.SelectClauses) + func NewSelectSQLGenerator(dialect string, do *SQLDialectOptions) SelectSQLGenerator + type TruncateSQLGenerator interface + Dialect func() string + Generate func(b sb.SQLBuilder, clauses exp.TruncateClauses) + func NewTruncateSQLGenerator(dialect string, do *SQLDialectOptions) TruncateSQLGenerator + type UpdateSQLGenerator interface + Dialect func() string + Generate func(b sb.SQLBuilder, clauses exp.UpdateClauses) + func NewUpdateSQLGenerator(dialect string, do *SQLDialectOptions) UpdateSQLGenerator