Repository: go-jet/jet
Pull request #35 (2020-04-03 04:56:57)

feat: support go modules
Have you given supporting go modules any thoughts? 


Patch:
diff --git a/README.md b/README.md
index 932fff5..721219a 100644
--- a/README.md
+++ b/README.md
@@ -568,5 +568,5 @@ To run the tests, additional dependencies are required:
 
 ## License
 
-Copyright 2019-2020 Goran Bjelanovic  
+Copyright 2019 Goran Bjelanovic  
 Licensed under the Apache License, Version 2.0.
diff --git a/generator/internal/metadata/table_meta_data.go b/generator/internal/metadata/table_meta_data.go
index bab1088..cb738fa 100644
--- a/generator/internal/metadata/table_meta_data.go
+++ b/generator/internal/metadata/table_meta_data.go
@@ -3,7 +3,6 @@ package metadata
 import (
 	"database/sql"
 	"github.com/go-jet/jet/internal/utils"
-	"strings"
 )
 
 // TableMetaData metadata struct
@@ -68,19 +67,15 @@ func (t TableMetaData) GoStructName() string {
 	return utils.ToGoIdentifier(t.name) + "Table"
 }
 
-// GoStructImplName returns go struct impl name for sql builder
-func (t TableMetaData) GoStructImplName() string {
-	name := utils.ToGoIdentifier(t.name) + "Table"
-	return string(strings.ToLower(name)[0]) + name[1:]
-}
-
 // GetTableMetaData returns table info metadata
 func GetTableMetaData(db *sql.DB, querySet DialectQuerySet, schemaName, tableName string) (tableInfo TableMetaData) {
+
 	tableInfo.SchemaName = schemaName
 	tableInfo.name = tableName
 
 	tableInfo.PrimaryKeys = getPrimaryKeys(db, querySet, schemaName, tableName)
 	tableInfo.Columns = getColumnsMetaData(db, querySet, schemaName, tableName)
+
 	return
 }
 
diff --git a/generator/internal/template/templates.go b/generator/internal/template/templates.go
index 353e6e1..40e4773 100644
--- a/generator/internal/template/templates.go
+++ b/generator/internal/template/templates.go
@@ -3,6 +3,7 @@ package template
 var autoGenWarningTemplate = `
 //
 // Code generated by go-jet DO NOT EDIT.
+// Generated at {{now}}
 //
 // WARNING: Changes to this file may cause incorrect behavior  
 // and will be lost if the code is regenerated
@@ -25,7 +26,7 @@ import (
 
 var {{ToGoIdentifier .Name}} = new{{.GoStructName}}()
 
-type {{.GoStructImplName}} struct {
+type {{.GoStructName}} struct {
 	{{dialect.PackageName}}.Table
 	
 	//Columns
@@ -37,45 +38,32 @@ type {{.GoStructImplName}} struct {
 	MutableColumns {{dialect.PackageName}}.ColumnList
 }
 
-type {{.GoStructName}} struct {
-	{{.GoStructImplName}}
-
-	EXCLUDED {{.GoStructImplName}}
-}
-
 // creates new {{.GoStructName}} with assigned alias
 func (a *{{.GoStructName}}) AS(alias string) *{{.GoStructName}} {
 	aliasTable := new{{.GoStructName}}()
+
 	aliasTable.Table.AS(alias)
+
 	return aliasTable
 }
 
 func new{{.GoStructName}}() *{{.GoStructName}} {
-	return &{{.GoStructName}}{
-		{{.GoStructImplName}}: new{{.GoStructName}}Impl("{{.SchemaName}}", "{{.Name}}"),
-		EXCLUDED:  new{{.GoStructName}}Impl("", "excluded"),
-	}
-}
-
-func new{{.GoStructName}}Impl(schemaName, tableName string) {{.GoStructImplName}} {
 	var (
 	{{- range .Columns}}
 		{{ToGoIdentifier .Name}}Column = {{dialect.PackageName}}.{{.SqlBuilderColumnType}}Column("{{.Name}}")
 	{{- end}}
-		allColumns     = {{dialect.PackageName}}.ColumnList{ {{template "column-list" .Columns}} }
-		mutableColumns = {{dialect.PackageName}}.ColumnList{ {{template "column-list" .MutableColumns}} }
 	)
 
-	return {{.GoStructImplName}}{
-		Table: {{dialect.PackageName}}.NewTable(schemaName, tableName, allColumns...),
+	return &{{.GoStructName}}{
+		Table: {{dialect.PackageName}}.NewTable("{{.SchemaName}}", "{{.Name}}", {{template "column-list" .Columns}}),
 
 		//Columns
 {{- range .Columns}}
 		{{ToGoIdentifier .Name}}: {{ToGoIdentifier .Name}}Column,
 {{- end}}
 
-		AllColumns:     allColumns,
-		MutableColumns: mutableColumns,
+		AllColumns:     {{dialect.PackageName}}.ColumnList{ {{template "column-list" .Columns}} },
+		MutableColumns: {{dialect.PackageName}}.ColumnList{ {{template "column-list" .MutableColumns}} },
 	}
 }
 
diff --git a/go.mod b/go.mod
new file mode 100644
index 0000000..b92c41a
--- /dev/null
+++ b/go.mod
@@ -0,0 +1,12 @@
+module github.com/go-jet/jet
+
+go 1.14
+
+require (
+	github.com/go-sql-driver/mysql v1.5.0
+	github.com/google/go-cmp v0.4.0
+	github.com/google/uuid v1.1.1
+	github.com/lib/pq v1.3.0
+	github.com/pkg/profile v1.4.0
+	github.com/stretchr/testify v1.5.1
+)
diff --git a/go.sum b/go.sum
new file mode 100644
index 0000000..c3d7a26
--- /dev/null
+++ b/go.sum
@@ -0,0 +1,23 @@
+github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
+github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs=
+github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
+github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
+github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
+github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/lib/pq v1.3.0 h1:/qkRGz8zljWiDcFvgpwUpwIAPu3r07TDvs3Rws+o/pU=
+github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
+github.com/pkg/profile v1.4.0 h1:uCmaf4vVbWAOZz36k1hrQD7ijGRzLwaME8Am/7a4jZI=
+github.com/pkg/profile v1.4.0/go.mod h1:NWz/XGvpEW1FyYQ7fCx4dqYBLlfTcE+A9FLAkNKqjFE=
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
+github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
+golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
+golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
+gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
diff --git a/internal/jet/cast.go b/internal/jet/cast.go
index e8045e7..c5fe9a7 100644
--- a/internal/jet/cast.go
+++ b/internal/jet/cast.go
@@ -42,12 +42,12 @@ func (b *castExpression) serialize(statement StatementType, out *SQLBuilder, opt
 	castType := b.cast
 
 	if castOverride := out.Dialect.OperatorSerializeOverride("CAST"); castOverride != nil {
-		castOverride(expression, String(castType))(statement, out, FallTrough(options)...)
+		castOverride(expression, String(castType))(statement, out, options...)
 		return
 	}
 
 	out.WriteString("CAST(")
-	expression.serialize(statement, out, FallTrough(options)...)
+	expression.serialize(statement, out, options...)
 	out.WriteString("AS")
 	out.WriteString(castType + ")")
 }
diff --git a/internal/jet/clause.go b/internal/jet/clause.go
index 90d194e..738074b 100644
--- a/internal/jet/clause.go
+++ b/internal/jet/clause.go
@@ -6,7 +6,7 @@ import (
 
 // Clause interface
 type Clause interface {
-	Serialize(statementType StatementType, out *SQLBuilder, options ...SerializeOption)
+	Serialize(statementType StatementType, out *SQLBuilder)
 }
 
 // ClauseWithProjections interface
@@ -27,7 +27,7 @@ func (s *ClauseSelect) projections() ProjectionList {
 }
 
 // Serialize serializes clause into SQLBuilder
-func (s *ClauseSelect) Serialize(statementType StatementType, out *SQLBuilder, options ...SerializeOption) {
+func (s *ClauseSelect) Serialize(statementType StatementType, out *SQLBuilder) {
 	out.NewLine()
 	out.WriteString("SELECT")
 
@@ -48,7 +48,7 @@ type ClauseFrom struct {
 }
 
 // Serialize serializes clause into SQLBuilder
-func (f *ClauseFrom) Serialize(statementType StatementType, out *SQLBuilder, options ...SerializeOption) {
+func (f *ClauseFrom) Serialize(statementType StatementType, out *SQLBuilder) {
 	if f.Table == nil {
 		return
 	}
@@ -56,7 +56,7 @@ func (f *ClauseFrom) Serialize(statementType StatementType, out *SQLBuilder, opt
 	out.WriteString("FROM")
 
 	out.IncreaseIdent()
-	f.Table.serialize(statementType, out, FallTrough(options)...)
+	f.Table.serialize(statementType, out)
 	out.DecreaseIdent()
 }
 
@@ -67,20 +67,18 @@ type ClauseWhere struct {
 }
 
 // Serialize serializes clause into SQLBuilder
-func (c *ClauseWhere) Serialize(statementType StatementType, out *SQLBuilder, options ...SerializeOption) {
+func (c *ClauseWhere) Serialize(statementType StatementType, out *SQLBuilder) {
 	if c.Condition == nil {
 		if c.Mandatory {
 			panic("jet: WHERE clause not set")
 		}
 		return
 	}
-	if !contains(options, SkipNewLine) {
-		out.NewLine()
-	}
+	out.NewLine()
 	out.WriteString("WHERE")
 
 	out.IncreaseIdent()
-	c.Condition.serialize(statementType, out, NoWrap.WithFallTrough(options)...)
+	c.Condition.serialize(statementType, out, noWrap)
 	out.DecreaseIdent()
 }
 
@@ -90,7 +88,7 @@ type ClauseGroupBy struct {
 }
 
 // Serialize serializes clause into SQLBuilder
-func (c *ClauseGroupBy) Serialize(statementType StatementType, out *SQLBuilder, options ...SerializeOption) {
+func (c *ClauseGroupBy) Serialize(statementType StatementType, out *SQLBuilder) {
 	if len(c.List) == 0 {
 		return
 	}
@@ -121,7 +119,7 @@ type ClauseHaving struct {
 }
 
 // Serialize serializes clause into SQLBuilder
-func (c *ClauseHaving) Serialize(statementType StatementType, out *SQLBuilder, options ...SerializeOption) {
+func (c *ClauseHaving) Serialize(statementType StatementType, out *SQLBuilder) {
 	if c.Condition == nil {
 		return
 	}
@@ -130,7 +128,7 @@ func (c *ClauseHaving) Serialize(statementType StatementType, out *SQLBuilder, o
 	out.WriteString("HAVING")
 
 	out.IncreaseIdent()
-	c.Condition.serialize(statementType, out, NoWrap.WithFallTrough(options)...)
+	c.Condition.serialize(statementType, out, noWrap)
 	out.DecreaseIdent()
 }
 
@@ -141,7 +139,7 @@ type ClauseOrderBy struct {
 }
 
 // Serialize serializes clause into SQLBuilder
-func (o *ClauseOrderBy) Serialize(statementType StatementType, out *SQLBuilder, options ...SerializeOption) {
+func (o *ClauseOrderBy) Serialize(statementType StatementType, out *SQLBuilder) {
 	if o.List == nil {
 		return
 	}
@@ -170,7 +168,7 @@ type ClauseLimit struct {
 }
 
 // Serialize serializes clause into SQLBuilder
-func (l *ClauseLimit) Serialize(statementType StatementType, out *SQLBuilder, options ...SerializeOption) {
+func (l *ClauseLimit) Serialize(statementType StatementType, out *SQLBuilder) {
 	if l.Count >= 0 {
 		out.NewLine()
 		out.WriteString("LIMIT")
@@ -184,7 +182,7 @@ type ClauseOffset struct {
 }
 
 // Serialize serializes clause into SQLBuilder
-func (o *ClauseOffset) Serialize(statementType StatementType, out *SQLBuilder, options ...SerializeOption) {
+func (o *ClauseOffset) Serialize(statementType StatementType, out *SQLBuilder) {
 	if o.Count >= 0 {
 		out.NewLine()
 		out.WriteString("OFFSET")
@@ -198,14 +196,14 @@ type ClauseFor struct {
 }
 
 // Serialize serializes clause into SQLBuilder
-func (f *ClauseFor) Serialize(statementType StatementType, out *SQLBuilder, options ...SerializeOption) {
+func (f *ClauseFor) Serialize(statementType StatementType, out *SQLBuilder) {
 	if f.Lock == nil {
 		return
 	}
 
 	out.NewLine()
 	out.WriteString("FOR")
-	f.Lock.serialize(statementType, out, FallTrough(options)...)
+	f.Lock.serialize(statementType, out)
 }
 
 // ClauseSetStmtOperator struct
@@ -226,7 +224,7 @@ func (s *ClauseSetStmtOperator) projections() ProjectionList {
 }
 
 // Serialize serializes clause into SQLBuilder
-func (s *ClauseSetStmtOperator) Serialize(statementType StatementType, out *SQLBuilder, options ...SerializeOption) {
+func (s *ClauseSetStmtOperator) Serialize(statementType StatementType, out *SQLBuilder) {
 	if len(s.Selects) < 2 {
 		panic("jet: UNION Statement must contain at least two SELECT statements")
 	}
@@ -246,7 +244,7 @@ func (s *ClauseSetStmtOperator) Serialize(statementType StatementType, out *SQLB
 			panic("jet: select statement of '" + s.Operator + "' is nil")
 		}
 
-		selectStmt.serialize(statementType, out, FallTrough(options)...)
+		selectStmt.serialize(statementType, out)
 	}
 
 	s.OrderBy.Serialize(statementType, out)
@@ -260,7 +258,7 @@ type ClauseUpdate struct {
 }
 
 // Serialize serializes clause into SQLBuilder
-func (u *ClauseUpdate) Serialize(statementType StatementType, out *SQLBuilder, options ...SerializeOption) {
+func (u *ClauseUpdate) Serialize(statementType StatementType, out *SQLBuilder) {
 	out.NewLine()
 	out.WriteString("UPDATE")
 
@@ -268,7 +266,7 @@ func (u *ClauseUpdate) Serialize(statementType StatementType, out *SQLBuilder, o
 		panic("jet: table to update is nil")
 	}
 
-	u.Table.serialize(statementType, out, FallTrough(options)...)
+	u.Table.serialize(statementType, out)
 }
 
 // ClauseSet struct
@@ -278,7 +276,7 @@ type ClauseSet struct {
 }
 
 // Serialize serializes clause into SQLBuilder
-func (s *ClauseSet) Serialize(statementType StatementType, out *SQLBuilder, options ...SerializeOption) {
+func (s *ClauseSet) Serialize(statementType StatementType, out *SQLBuilder) {
 	out.NewLine()
 	out.WriteString("SET")
 
@@ -301,7 +299,7 @@ func (s *ClauseSet) Serialize(statementType StatementType, out *SQLBuilder, opti
 
 		out.WriteString(" = ")
 
-		s.Values[i].serialize(UpdateStatementType, out, FallTrough(options)...)
+		s.Values[i].serialize(UpdateStatementType, out)
 	}
 	out.DecreaseIdent(4)
 }
@@ -322,7 +320,7 @@ func (i *ClauseInsert) GetColumns() []Column {
 }
 
 // Serialize serializes clause into SQLBuilder
-func (i *ClauseInsert) Serialize(statementType StatementType, out *SQLBuilder, options ...SerializeOption) {
+func (i *ClauseInsert) Serialize(statementType StatementType, out *SQLBuilder) {
 	out.NewLine()
 	out.WriteString("INSERT INTO")
 
@@ -348,7 +346,7 @@ type ClauseValuesQuery struct {
 }
 
 // Serialize serializes clause into SQLBuilder
-func (v *ClauseValuesQuery) Serialize(statementType StatementType, out *SQLBuilder, options ...SerializeOption) {
+func (v *ClauseValuesQuery) Serialize(statementType StatementType, out *SQLBuilder) {
 	if len(v.Rows) == 0 && v.Query == nil {
 		panic("jet: VALUES or QUERY has to be specified for INSERT statement")
 	}
@@ -357,8 +355,8 @@ func (v *ClauseValuesQuery) Serialize(statementType StatementType, out *SQLBuild
 		panic("jet: VALUES or QUERY has to be specified for INSERT statement")
 	}
 
-	v.ClauseValues.Serialize(statementType, out, FallTrough(options)...)
-	v.ClauseQuery.Serialize(statementType, out, FallTrough(options)...)
+	v.ClauseValues.Serialize(statementType, out)
+	v.ClauseQuery.Serialize(statementType, out)
 }
 
 // ClauseValues struct
@@ -367,29 +365,27 @@ type ClauseValues struct {
 }
 
 // Serialize serializes clause into SQLBuilder
-func (v *ClauseValues) Serialize(statementType StatementType, out *SQLBuilder, options ...SerializeOption) {
+func (v *ClauseValues) Serialize(statementType StatementType, out *SQLBuilder) {
 	if len(v.Rows) == 0 {
 		return
 	}
 
-	out.NewLine()
 	out.WriteString("VALUES")
 
 	for rowIndex, row := range v.Rows {
 		if rowIndex > 0 {
 			out.WriteString(",")
-			out.NewLine()
-		} else {
-			out.IncreaseIdent(7)
 		}
 
+		out.IncreaseIdent()
+		out.NewLine()
 		out.WriteString("(")
 
 		SerializeClauseList(statementType, row, out)
 
 		out.WriteByte(')')
+		out.DecreaseIdent()
 	}
-	out.DecreaseIdent(7)
 }
 
 // ClauseQuery struct
@@ -398,12 +394,12 @@ type ClauseQuery struct {
 }
 
 // Serialize serializes clause into SQLBuilder
-func (v *ClauseQuery) Serialize(statementType StatementType, out *SQLBuilder, options ...SerializeOption) {
+func (v *ClauseQuery) Serialize(statementType StatementType, out *SQLBuilder) {
 	if v.Query == nil {
 		return
 	}
 
-	v.Query.serialize(statementType, out, FallTrough(options)...)
+	v.Query.serialize(statementType, out)
 }
 
 // ClauseDelete struct
@@ -412,7 +408,7 @@ type ClauseDelete struct {
 }
 
 // Serialize serializes clause into SQLBuilder
-func (d *ClauseDelete) Serialize(statementType StatementType, out *SQLBuilder, options ...SerializeOption) {
+func (d *ClauseDelete) Serialize(statementType StatementType, out *SQLBuilder) {
 	out.NewLine()
 	out.WriteString("DELETE FROM")
 
@@ -420,7 +416,7 @@ func (d *ClauseDelete) Serialize(statementType StatementType, out *SQLBuilder, o
 		panic("jet: nil table in DELETE clause")
 	}
 
-	d.Table.serialize(statementType, out, FallTrough(options)...)
+	d.Table.serialize(statementType, out)
 }
 
 // ClauseStatementBegin struct
@@ -430,7 +426,7 @@ type ClauseStatementBegin struct {
 }
 
 // Serialize serializes clause into SQLBuilder
-func (d *ClauseStatementBegin) Serialize(statementType StatementType, out *SQLBuilder, options ...SerializeOption) {
+func (d *ClauseStatementBegin) Serialize(statementType StatementType, out *SQLBuilder) {
 	out.NewLine()
 	out.WriteString(d.Name)
 
@@ -439,7 +435,7 @@ func (d *ClauseStatementBegin) Serialize(statementType StatementType, out *SQLBu
 			out.WriteString(", ")
 		}
 
-		table.serialize(statementType, out, FallTrough(options)...)
+		table.serialize(statementType, out)
 	}
 }
 
@@ -451,7 +447,7 @@ type ClauseOptional struct {
 }
 
 // Serialize serializes clause into SQLBuilder
-func (d *ClauseOptional) Serialize(statementType StatementType, out *SQLBuilder, options ...SerializeOption) {
+func (d *ClauseOptional) Serialize(statementType StatementType, out *SQLBuilder) {
 	if !d.Show {
 		return
 	}
@@ -467,7 +463,7 @@ type ClauseIn struct {
 }
 
 // Serialize serializes clause into SQLBuilder
-func (i *ClauseIn) Serialize(statementType StatementType, out *SQLBuilder, options ...SerializeOption) {
+func (i *ClauseIn) Serialize(statementType StatementType, out *SQLBuilder) {
 	if i.LockMode == "" {
 		return
 	}
@@ -489,7 +485,7 @@ type ClauseWindow struct {
 }
 
 // Serialize serializes clause into SQLBuilder
-func (i *ClauseWindow) Serialize(statementType StatementType, out *SQLBuilder, options ...SerializeOption) {
+func (i *ClauseWindow) Serialize(statementType StatementType, out *SQLBuilder) {
 	if len(i.Definitions) == 0 {
 		return
 	}
@@ -507,44 +503,6 @@ func (i *ClauseWindow) Serialize(statementType StatementType, out *SQLBuilder, o
 			out.WriteString("()")
 			continue
 		}
-		def.Window.serialize(statementType, out, FallTrough(options)...)
-	}
-}
-
-// SetPair clause
-type SetPair struct {
-	Column ColumnSerializer
-	Value  Serializer
-}
-
-// SetClause clause
-type SetClause []SetPair
-
-// Serialize for SetClause
-func (s SetClause) Serialize(statementType StatementType, out *SQLBuilder, options ...SerializeOption) {
-	out.NewLine()
-	out.WriteString("SET")
-	out.IncreaseIdent(4)
-
-	for i, pair := range s {
-		if i > 0 {
-			out.WriteString(",")
-			out.NewLine()
-		}
-
-		pair.Column.serialize(statementType, out, ShortName.WithFallTrough(options)...)
-		out.WriteString("=")
-		pair.Value.serialize(statementType, out, FallTrough(options)...)
+		def.Window.serialize(statementType, out)
 	}
-	out.DecreaseIdent(4)
-}
-
-// KeywordClause type
-type KeywordClause struct {
-	Keyword
-}
-
-// Serialize for KeywordClause
-func (k KeywordClause) Serialize(statementType StatementType, out *SQLBuilder, options ...SerializeOption) {
-	k.serialize(statementType, out, FallTrough(options)...)
 }
diff --git a/internal/jet/column.go b/internal/jet/column.go
index 0fd59be..85c053e 100644
--- a/internal/jet/column.go
+++ b/internal/jet/column.go
@@ -12,12 +12,6 @@ type Column interface {
 	defaultAlias() string
 }
 
-// ColumnSerializer is interface for all serializable columns
-type ColumnSerializer interface {
-	Serializer
-	Column
-}
-
 // ColumnExpression interface
 type ColumnExpression interface {
 	Column
@@ -107,7 +101,7 @@ func (c ColumnExpressionImpl) serialize(statement StatementType, out *SQLBuilder
 		out.WriteByte('.')
 		out.WriteIdentifier(c.defaultAlias(), true)
 	} else {
-		if c.tableName != "" && !contains(options, ShortName) {
+		if c.tableName != "" {
 			out.WriteIdentifier(c.tableName)
 			out.WriteByte('.')
 		}
@@ -131,17 +125,6 @@ func (cl ColumnList) fromImpl(subQuery SelectTable) Projection {
 	return newProjectionList
 }
 
-func (cl ColumnList) serialize(statement StatementType, out *SQLBuilder, options ...SerializeOption) {
-	out.WriteString("(")
-	for i, column := range cl {
-		if i > 0 {
-			out.WriteString(", ")
-		}
-		column.serialize(statement, out, FallTrough(options)...)
-	}
-	out.WriteString(")")
-}
-
 func (cl ColumnList) serializeForProjection(statement StatementType, out *SQLBuilder) {
 	projections := ColumnListToProjectionList(cl)
 
diff --git a/internal/jet/expression.go b/internal/jet/expression.go
index d807534..a463b76 100644
--- a/internal/jet/expression.go
+++ b/internal/jet/expression.go
@@ -72,15 +72,15 @@ func (e *ExpressionInterfaceImpl) DESC() OrderByClause {
 }
 
 func (e *ExpressionInterfaceImpl) serializeForGroupBy(statement StatementType, out *SQLBuilder) {
-	e.Parent.serialize(statement, out, NoWrap)
+	e.Parent.serialize(statement, out, noWrap)
 }
 
 func (e *ExpressionInterfaceImpl) serializeForProjection(statement StatementType, out *SQLBuilder) {
-	e.Parent.serialize(statement, out, NoWrap)
+	e.Parent.serialize(statement, out, noWrap)
 }
 
 func (e *ExpressionInterfaceImpl) serializeForOrderBy(statement StatementType, out *SQLBuilder) {
-	e.Parent.serialize(statement, out, NoWrap)
+	e.Parent.serialize(statement, out, noWrap)
 }
 
 // Representation of binary operations (e.g. comparisons, arithmetic)
@@ -117,7 +117,7 @@ func (c *binaryOperatorExpression) serialize(statement StatementType, out *SQLBu
 		panic("jet: rhs is nil for '" + c.operator + "' operator")
 	}
 
-	wrap := !contains(options, NoWrap)
+	wrap := !contains(options, noWrap)
 
 	if wrap {
 		out.WriteString("(")
@@ -125,11 +125,11 @@ func (c *binaryOperatorExpression) serialize(statement StatementType, out *SQLBu
 
 	if serializeOverride := out.Dialect.OperatorSerializeOverride(c.operator); serializeOverride != nil {
 		serializeOverrideFunc := serializeOverride(c.lhs, c.rhs, c.additionalParam)
-		serializeOverrideFunc(statement, out, FallTrough(options)...)
+		serializeOverrideFunc(statement, out, options...)
 	} else {
-		c.lhs.serialize(statement, out, FallTrough(options)...)
+		c.lhs.serialize(statement, out)
 		out.WriteString(c.operator)
-		c.rhs.serialize(statement, out, FallTrough(options)...)
+		c.rhs.serialize(statement, out)
 	}
 
 	if wrap {
@@ -163,7 +163,7 @@ func (p *prefixExpression) serialize(statement StatementType, out *SQLBuilder, o
 		panic("jet: nil prefix expression in prefix operator " + p.operator)
 	}
 
-	p.expression.serialize(statement, out, FallTrough(options)...)
+	p.expression.serialize(statement, out)
 
 	out.WriteString(")")
 }
@@ -192,7 +192,7 @@ func (p *postfixOpExpression) serialize(statement StatementType, out *SQLBuilder
 		panic("jet: nil prefix expression in postfix operator " + p.operator)
 	}
 
-	p.expression.serialize(statement, out, FallTrough(options)...)
+	p.expression.serialize(statement, out)
 
 	out.WriteString(p.operator)
 }
diff --git a/internal/jet/func_expression.go b/internal/jet/func_expression.go
index e95bece..f38c9a2 100644
--- a/internal/jet/func_expression.go
+++ b/internal/jet/func_expression.go
@@ -613,7 +613,7 @@ func newWindowFunc(name string, expressions ...Expression) windowExpression {
 func (f *funcExpressionImpl) serialize(statement StatementType, out *SQLBuilder, options ...SerializeOption) {
 	if serializeOverride := out.Dialect.FunctionSerializeOverride(f.name); serializeOverride != nil {
 		serializeOverrideFunc := serializeOverride(ExpressionListToSerializerList(f.expressions)...)
-		serializeOverrideFunc(statement, out, FallTrough(options)...)
+		serializeOverrideFunc(statement, out, options...)
 		return
 	}
 
diff --git a/internal/jet/interval.go b/internal/jet/interval.go
index 5b371e1..fab84e0 100644
--- a/internal/jet/interval.go
+++ b/internal/jet/interval.go
@@ -33,5 +33,5 @@ type IntervalImpl struct {
 
 func (i IntervalImpl) serialize(statement StatementType, out *SQLBuilder, options ...SerializeOption) {
 	out.WriteString("INTERVAL")
-	i.interval.serialize(statement, out, FallTrough(options)...)
+	i.interval.serialize(statement, out, options...)
 }
diff --git a/internal/jet/keyword.go b/internal/jet/keyword.go
index a40538e..c903ad6 100644
--- a/internal/jet/keyword.go
+++ b/internal/jet/keyword.go
@@ -2,12 +2,18 @@ package jet
 
 const (
 	// DEFAULT is jet equivalent of SQL DEFAULT
-	DEFAULT Keyword = "DEFAULT"
+	DEFAULT keywordClause = "DEFAULT"
 )
 
-// Keyword type
-type Keyword string
+var (
+	// NULL is jet equivalent of SQL NULL
+	NULL = newNullLiteral()
+	// STAR is jet equivalent of SQL *
+	STAR = newStarLiteral()
+)
+
+type keywordClause string
 
-func (k Keyword) serialize(statement StatementType, out *SQLBuilder, options ...SerializeOption) {
+func (k keywordClause) serialize(statement StatementType, out *SQLBuilder, options ...SerializeOption) {
 	out.WriteString(string(k))
 }
diff --git a/internal/jet/literal_expression.go b/internal/jet/literal_expression.go
index 8cdb3d7..15c8a4a 100644
--- a/internal/jet/literal_expression.go
+++ b/internal/jet/literal_expression.go
@@ -278,14 +278,6 @@ func formatNanoseconds(nanoseconds ...time.Duration) string {
 }
 
 //--------------------------------------------------//
-
-var (
-	// NULL is jet equivalent of SQL NULL
-	NULL = newNullLiteral()
-	// STAR is jet equivalent of SQL *
-	STAR = newStarLiteral()
-)
-
 type nullLiteral struct {
 	ExpressionInterfaceImpl
 }
diff --git a/internal/jet/operators.go b/internal/jet/operators.go
index 19173a6..d17081c 100644
--- a/internal/jet/operators.go
+++ b/internal/jet/operators.go
@@ -147,7 +147,7 @@ func (c *caseOperatorImpl) serialize(statement StatementType, out *SQLBuilder, o
 	out.WriteString("(CASE")
 
 	if c.expression != nil {
-		c.expression.serialize(statement, out, FallTrough(options)...)
+		c.expression.serialize(statement, out)
 	}
 
 	if len(c.when) == 0 || len(c.then) == 0 {
@@ -160,15 +160,15 @@ func (c *caseOperatorImpl) serialize(statement StatementType, out *SQLBuilder, o
 
 	for i, when := range c.when {
 		out.WriteString("WHEN")
-		when.serialize(statement, out, NoWrap)
+		when.serialize(statement, out, noWrap)
 
 		out.WriteString("THEN")
-		c.then[i].serialize(statement, out, NoWrap)
+		c.then[i].serialize(statement, out, noWrap)
 	}
 
 	if c.els != nil {
 		out.WriteString("ELSE")
-		c.els.serialize(statement, out, NoWrap)
+		c.els.serialize(statement, out, noWrap)
 	}
 
 	out.WriteString("END)")
diff --git a/internal/jet/serializer.go b/internal/jet/serializer.go
index 2f014cc..dc661d7 100644
--- a/internal/jet/serializer.go
+++ b/internal/jet/serializer.go
@@ -5,18 +5,9 @@ type SerializeOption int
 
 // Serialize options
 const (
-	NoWrap SerializeOption = iota
-	SkipNewLine
-
-	fallTroughOptions // fall trough options
-	ShortName
+	noWrap SerializeOption = iota
 )
 
-// WithFallTrough extends existing serialize options with additional
-func (s SerializeOption) WithFallTrough(options []SerializeOption) []SerializeOption {
-	return append(FallTrough(options), s)
-}
-
 // StatementType is type of the SQL statement
 type StatementType string
 
@@ -51,19 +42,6 @@ func contains(options []SerializeOption, option SerializeOption) bool {
 	return false
 }
 
-// FallTrough filters fall-trough options from the list
-func FallTrough(options []SerializeOption) []SerializeOption {
-	var ret []SerializeOption
-
-	for _, option := range options {
-		if option > fallTroughOptions {
-			ret = append(ret, option)
-		}
-	}
-
-	return ret
-}
-
 // ListSerializer serializes list of serializers with separator
 type ListSerializer struct {
 	Serializers []Serializer
@@ -75,21 +53,6 @@ func (s ListSerializer) serialize(statement StatementType, out *SQLBuilder, opti
 		if i > 0 {
 			out.WriteString(s.Separator)
 		}
-		ser.serialize(statement, out, FallTrough(options)...)
-	}
-}
-
-// NewSerializerClauseImpl is constructor for Seralizer with list of clauses
-func NewSerializerClauseImpl(clauses ...Clause) Serializer {
-	return &serializerImpl{Clauses: clauses}
-}
-
-type serializerImpl struct {
-	Clauses []Clause
-}
-
-func (s serializerImpl) serialize(statement StatementType, out *SQLBuilder, options ...SerializeOption) {
-	for _, clause := range s.Clauses {
-		clause.Serialize(statement, out, FallTrough(options)...)
+		ser.serialize(statement, out)
 	}
 }
diff --git a/internal/jet/sql_builder.go b/internal/jet/sql_builder.go
index 642f0cd..ef7f801 100644
--- a/internal/jet/sql_builder.go
+++ b/internal/jet/sql_builder.go
@@ -98,7 +98,7 @@ func (s *SQLBuilder) WriteString(str string) {
 
 // WriteIdentifier adds identifier to output SQL
 func (s *SQLBuilder) WriteIdentifier(name string, alwaysQuote ...bool) {
-	if s.shouldQuote(name, alwaysQuote...) {
+	if s.Dialect.IsReservedWord(name) || shouldQuoteIdentifier(name) || len(alwaysQuote) > 0 {
 		identQuoteChar := string(s.Dialect.IdentifierQuoteChar())
 		s.WriteString(identQuoteChar + name + identQuoteChar)
 	} else {
@@ -106,10 +106,6 @@ func (s *SQLBuilder) WriteIdentifier(name string, alwaysQuote ...bool) {
 	}
 }
 
-func (s *SQLBuilder) shouldQuote(name string, alwaysQuote ...bool) bool {
-	return s.Dialect.IsReservedWord(name) || shouldQuoteIdentifier(name) || len(alwaysQuote) > 0
-}
-
 // WriteByte writes byte to output SQL
 func (s *SQLBuilder) WriteByte(b byte) {
 	s.write([]byte{b})
diff --git a/internal/jet/statement.go b/internal/jet/statement.go
index beb52f1..3b0638d 100644
--- a/internal/jet/statement.go
+++ b/internal/jet/statement.go
@@ -58,7 +58,7 @@ func (s *serializerStatementInterfaceImpl) Sql() (query string, args []interface
 
 	queryData := &SQLBuilder{Dialect: s.dialect}
 
-	s.parent.serialize(s.statementType, queryData, NoWrap)
+	s.parent.serialize(s.statementType, queryData, noWrap)
 
 	query, args = queryData.finalize()
 	return
@@ -67,7 +67,7 @@ func (s *serializerStatementInterfaceImpl) Sql() (query string, args []interface
 func (s *serializerStatementInterfaceImpl) DebugSql() (query string) {
 	sqlBuilder := &SQLBuilder{Dialect: s.dialect, Debug: true}
 
-	s.parent.serialize(s.statementType, sqlBuilder, NoWrap)
+	s.parent.serialize(s.statementType, sqlBuilder, noWrap)
 
 	query, _ = sqlBuilder.finalize()
 	return
@@ -157,16 +157,16 @@ func (s *statementImpl) projections() ProjectionList {
 
 func (s *statementImpl) serialize(statement StatementType, out *SQLBuilder, options ...SerializeOption) {
 
-	if !contains(options, NoWrap) {
+	if !contains(options, noWrap) {
 		out.WriteString("(")
 		out.IncreaseIdent()
 	}
 
 	for _, clause := range s.Clauses {
-		clause.Serialize(statement, out, FallTrough(options)...)
+		clause.Serialize(statement, out)
 	}
 
-	if !contains(options, NoWrap) {
+	if !contains(options, noWrap) {
 		out.DecreaseIdent()
 		out.NewLine()
 		out.WriteString(")")
diff --git a/internal/jet/table.go b/internal/jet/table.go
index ca76e3a..4379000 100644
--- a/internal/jet/table.go
+++ b/internal/jet/table.go
@@ -19,15 +19,17 @@ type Table interface {
 }
 
 // NewTable creates new table with schema Name, table Name and list of columns
-func NewTable(schemaName, name string, columns ...ColumnExpression) SerializerTable {
+func NewTable(schemaName, name string, column ColumnExpression, columns ...ColumnExpression) SerializerTable {
+
+	columnList := append([]ColumnExpression{column}, columns...)
 
 	t := tableImpl{
 		schemaName: schemaName,
 		name:       name,
-		columnList: columns,
+		columnList: columnList,
 	}
 
-	for _, c := range columns {
+	for _, c := range columnList {
 		c.setTableName(name)
 	}
 
@@ -154,7 +156,7 @@ func (t *joinTableImpl) serialize(statement StatementType, out *SQLBuilder, opti
 		panic("jet: left hand side of join operation is nil table")
 	}
 
-	t.lhs.serialize(statement, out, FallTrough(options)...)
+	t.lhs.serialize(statement, out)
 
 	out.NewLine()
 
diff --git a/internal/jet/utils.go b/internal/jet/utils.go
index 50f4e13..126ce32 100644
--- a/internal/jet/utils.go
+++ b/internal/jet/utils.go
@@ -63,22 +63,6 @@ func SerializeColumnNames(columns []Column, out *SQLBuilder) {
 	}
 }
 
-// SerializeColumnExpressionNames func
-func SerializeColumnExpressionNames(columns []ColumnExpression, statementType StatementType,
-	out *SQLBuilder, options ...SerializeOption) {
-	for i, col := range columns {
-		if i > 0 {
-			out.WriteString(", ")
-		}
-
-		if col == nil {
-			panic("jet: nil column in columns list")
-		}
-
-		col.serialize(statementType, out, options...)
-	}
-}
-
 // ExpressionListToSerializerList converts list of expressions to list of serializers
 func ExpressionListToSerializerList(expressions []Expression) []Serializer {
 	var ret []Serializer
@@ -101,8 +85,7 @@ func ColumnListToProjectionList(columns []ColumnExpression) []Projection {
 	return ret
 }
 
-// ToSerializerValue creates Serializer type from the value
-func ToSerializerValue(value interface{}) Serializer {
+func valueToClause(value interface{}) Serializer {
 	if clause, ok := value.(Serializer); ok {
 		return clause
 	}
@@ -165,7 +148,7 @@ func UnwindRowFromValues(value interface{}, values []interface{}) []Serializer {
 	allValues := append([]interface{}{value}, values...)
 
 	for _, val := range allValues {
-		row = append(row, ToSerializerValue(val))
+		row = append(row, valueToClause(val))
 	}
 
 	return row
diff --git a/internal/jet/window_expression.go b/internal/jet/window_expression.go
index e5f18c1..3e7f1c7 100644
--- a/internal/jet/window_expression.go
+++ b/internal/jet/window_expression.go
@@ -17,7 +17,7 @@ func (w *commonWindowImpl) serialize(statement StatementType, out *SQLBuilder, o
 	w.expression.serialize(statement, out)
 	if w.window != nil {
 		out.WriteString("OVER")
-		w.window.serialize(statement, out, FallTrough(options)...)
+		w.window.serialize(statement, out)
 	}
 }
 
@@ -49,7 +49,7 @@ func (f *windowExpressionImpl) OVER(window ...Window) Expression {
 }
 
 func (f *windowExpressionImpl) serialize(statement StatementType, out *SQLBuilder, options ...SerializeOption) {
-	f.commonWindowImpl.serialize(statement, out, FallTrough(options)...)
+	f.commonWindowImpl.serialize(statement, out)
 }
 
 // -----------------------------------------------------
@@ -80,7 +80,7 @@ func (f *floatWindowExpressionImpl) OVER(window ...Window) FloatExpression {
 }
 
 func (f *floatWindowExpressionImpl) serialize(statement StatementType, out *SQLBuilder, options ...SerializeOption) {
-	f.commonWindowImpl.serialize(statement, out, FallTrough(options)...)
+	f.commonWindowImpl.serialize(statement, out)
 }
 
 // ------------------------------------------------
@@ -111,7 +111,7 @@ func (f *integerWindowExpressionImpl) OVER(window ...Window) IntegerExpression {
 }
 
 func (f *integerWindowExpressionImpl) serialize(statement StatementType, out *SQLBuilder, options ...SerializeOption) {
-	f.commonWindowImpl.serialize(statement, out, FallTrough(options)...)
+	f.commonWindowImpl.serialize(statement, out)
 }
 
 // ------------------------------------------------
@@ -142,5 +142,5 @@ func (f *boolWindowExpressionImpl) OVER(window ...Window) BoolExpression {
 }
 
 func (f *boolWindowExpressionImpl) serialize(statement StatementType, out *SQLBuilder, options ...SerializeOption) {
-	f.commonWindowImpl.serialize(statement, out, FallTrough(options)...)
+	f.commonWindowImpl.serialize(statement, out)
 }
diff --git a/internal/jet/window_func.go b/internal/jet/window_func.go
index 6602495..7f4d1b7 100644
--- a/internal/jet/window_func.go
+++ b/internal/jet/window_func.go
@@ -30,7 +30,7 @@ func newWindowImpl(parent Window) *windowImpl {
 }
 
 func (w *windowImpl) serialize(statement StatementType, out *SQLBuilder, options ...SerializeOption) {
-	if !contains(options, NoWrap) {
+	if !contains(options, noWrap) {
 		out.WriteByte('(')
 	}
 
@@ -40,7 +40,7 @@ func (w *windowImpl) serialize(statement StatementType, out *SQLBuilder, options
 		serializeExpressionList(statement, w.partitionBy, ", ", out)
 	}
 	w.orderBy.SkipNewLine = true
-	w.orderBy.Serialize(statement, out, FallTrough(options)...)
+	w.orderBy.Serialize(statement, out)
 
 	if w.frameUnits != "" {
 		out.WriteString(w.frameUnits)
@@ -55,7 +55,7 @@ func (w *windowImpl) serialize(statement StatementType, out *SQLBuilder, options
 		}
 	}
 
-	if !contains(options, NoWrap) {
+	if !contains(options, noWrap) {
 		out.WriteByte(')')
 	}
 }
@@ -139,7 +139,7 @@ func (f *frameExtentImpl) serialize(statement StatementType, out *SQLBuilder, op
 	if f == nil {
 		return
 	}
-	f.offset.serialize(statement, out, FallTrough(options)...)
+	f.offset.serialize(statement, out)
 
 	if f.preceding {
 		out.WriteString("PRECEDING")
@@ -152,12 +152,12 @@ func (f *frameExtentImpl) serialize(statement StatementType, out *SQLBuilder, op
 
 // Window function keywords
 var (
-	UNBOUNDED   = Keyword("UNBOUNDED")
+	UNBOUNDED   = keywordClause("UNBOUNDED")
 	CURRENT_ROW = frameExtentKeyword{"CURRENT ROW"}
 )
 
 type frameExtentKeyword struct {
-	Keyword
+	keywordClause
 }
 
 func (f frameExtentKeyword) isFrameExtent() {}
@@ -180,7 +180,7 @@ func (w windowName) serialize(statement StatementType, out *SQLBuilder, options
 	out.WriteByte('(')
 
 	out.WriteString(w.name)
-	w.windowImpl.serialize(statement, out, NoWrap.WithFallTrough(options)...)
+	w.windowImpl.serialize(statement, out, noWrap)
 
 	out.WriteByte(')')
 }
diff --git a/mysql/table.go b/mysql/table.go
index a4cf042..6d414a2 100644
--- a/mysql/table.go
+++ b/mysql/table.go
@@ -77,9 +77,9 @@ func (r *readableTableInterfaceImpl) CROSS_JOIN(table ReadableTable) joinSelectU
 }
 
 // NewTable creates new table with schema Name, table Name and list of columns
-func NewTable(schemaName, name string, columns ...jet.ColumnExpression) Table {
+func NewTable(schemaName, name string, column jet.ColumnExpression, columns ...jet.ColumnExpression) Table {
 	t := &tableImpl{
-		SerializerTable: jet.NewTable(schemaName, name, columns...),
+		SerializerTable: jet.NewTable(schemaName, name, column, columns...),
 	}
 
 	t.readableTableInterfaceImpl.parent = t
diff --git a/postgres/clause.go b/postgres/clause.go
deleted file mode 100644
index ad61b9a..0000000
--- a/postgres/clause.go
+++ /dev/null
@@ -1,87 +0,0 @@
-package postgres
-
-import (
-	"github.com/go-jet/jet/internal/jet"
-)
-
-type clauseReturning struct {
-	Projections []jet.Projection
-}
-
-func (r *clauseReturning) Serialize(statementType jet.StatementType, out *jet.SQLBuilder, options ...jet.SerializeOption) {
-	if len(r.Projections) == 0 {
-		return
-	}
-
-	out.NewLine()
-	out.WriteString("RETURNING")
-	out.IncreaseIdent()
-	out.WriteProjections(statementType, r.Projections)
-}
-
-// ========================================== //
-
-type onConflict interface {
-	ON_CONSTRAINT(name string) conflictTarget
-	WHERE(indexPredicate BoolExpression) conflictTarget
-	DO_NOTHING() InsertStatement
-	DO_UPDATE(action conflictAction) InsertStatement
-}
-
-type conflictTarget interface {
-	DO_NOTHING() InsertStatement
-	DO_UPDATE(action conflictAction) InsertStatement
-}
-
-type onConflictClause struct {
-	insertStatement  InsertStatement
-	constraint       string
-	indexExpressions []jet.ColumnExpression
-	whereClause      jet.ClauseWhere
-	do               jet.Serializer
-}
-
-func (o *onConflictClause) ON_CONSTRAINT(name string) conflictTarget {
-	o.constraint = name
-	return o
-}
-
-func (o *onConflictClause) WHERE(indexPredicate BoolExpression) conflictTarget {
-	o.whereClause.Condition = indexPredicate
-	return o
-}
-
-func (o *onConflictClause) DO_NOTHING() InsertStatement {
-	o.do = jet.Keyword("DO NOTHING")
-	return o.insertStatement
-}
-
-func (o *onConflictClause) DO_UPDATE(action conflictAction) InsertStatement {
-	o.do = action
-	return o.insertStatement
-}
-
-func (o *onConflictClause) Serialize(statementType jet.StatementType, out *jet.SQLBuilder, options ...jet.SerializeOption) {
-	if len(o.indexExpressions) == 0 && o.constraint == "" {
-		return
-	}
-
-	out.NewLine()
-	out.WriteString("ON CONFLICT")
-	if len(o.indexExpressions) > 0 {
-		out.WriteString("(")
-		jet.SerializeColumnExpressionNames(o.indexExpressions, statementType, out, jet.ShortName)
-		out.WriteString(")")
-	}
-
-	if o.constraint != "" {
-		out.WriteString("ON CONSTRAINT")
-		out.WriteString(o.constraint)
-	}
-
-	o.whereClause.Serialize(statementType, out, jet.SkipNewLine, jet.ShortName)
-
-	out.IncreaseIdent(7)
-	jet.Serialize(o.do, statementType, out)
-	out.DecreaseIdent(7)
-}
diff --git a/postgres/clauses.go b/postgres/clauses.go
new file mode 100644
index 0000000..a882b64
--- /dev/null
+++ b/postgres/clauses.go
@@ -0,0 +1,20 @@
+package postgres
+
+import (
+	"github.com/go-jet/jet/internal/jet"
+)
+
+type clauseReturning struct {
+	Projections []jet.Projection
+}
+
+func (r *clauseReturning) Serialize(statementType jet.StatementType, out *jet.SQLBuilder) {
+	if len(r.Projections) == 0 {
+		return
+	}
+
+	out.NewLine()
+	out.WriteString("RETURNING")
+	out.IncreaseIdent()
+	out.WriteProjections(statementType, r.Projections)
+}
diff --git a/postgres/conflict_action.go b/postgres/conflict_action.go
deleted file mode 100644
index 5ff7a19..0000000
--- a/postgres/conflict_action.go
+++ /dev/null
@@ -1,36 +0,0 @@
-package postgres
-
-import "github.com/go-jet/jet/internal/jet"
-
-type conflictAction interface {
-	jet.Serializer
-	SET(column jet.ColumnSerializer, expression interface{}) conflictAction
-	WHERE(condition BoolExpression) conflictAction
-}
-
-// SET creates conflict action for ON_CONFLICT clause
-func SET(column jet.ColumnSerializer, expression interface{}) conflictAction {
-	conflictAction := updateConflictActionImpl{}
-	conflictAction.doUpdate = jet.KeywordClause{Keyword: "DO UPDATE"}
-	conflictAction.Serializer = jet.NewSerializerClauseImpl(&conflictAction.doUpdate, &conflictAction.set, &conflictAction.where)
-	conflictAction.SET(column, expression)
-	return &conflictAction
-}
-
-type updateConflictActionImpl struct {
-	jet.Serializer
-
-	doUpdate jet.KeywordClause
-	set      jet.SetClause
-	where    jet.ClauseWhere
-}
-
-func (u *updateConflictActionImpl) SET(column jet.ColumnSerializer, expression interface{}) conflictAction {
-	u.set = append(u.set, jet.SetPair{Column: column, Value: jet.ToSerializerValue(expression)})
-	return u
-}
-
-func (u *updateConflictActionImpl) WHERE(condition BoolExpression) conflictAction {
-	u.where.Condition = condition
-	return u
-}
diff --git a/postgres/insert_statement.go b/postgres/insert_statement.go
index e4c72f5..a9dee25 100644
--- a/postgres/insert_statement.go
+++ b/postgres/insert_statement.go
@@ -11,18 +11,18 @@ type InsertStatement interface {
 	// Insert row of values, where value for each column is extracted from filed of structure data.
 	// If data is not struct or there is no field for every column selected, this method will panic.
 	MODEL(data interface{}) InsertStatement
+
 	MODELS(data interface{}) InsertStatement
-	QUERY(selectStatement SelectStatement) InsertStatement
 
-	ON_CONFLICT(indexExpressions ...jet.ColumnExpression) onConflict
+	QUERY(selectStatement SelectStatement) InsertStatement
 
-	RETURNING(projections ...Projection) InsertStatement
+	RETURNING(projections ...jet.Projection) InsertStatement
 }
 
 func newInsertStatement(table WritableTable, columns []jet.Column) InsertStatement {
 	newInsert := &insertStatementImpl{}
 	newInsert.SerializerStatement = jet.NewStatementImpl(Dialect, jet.InsertStatementType, newInsert,
-		&newInsert.Insert, &newInsert.ValuesQuery, &newInsert.OnConflict, &newInsert.Returning)
+		&newInsert.Insert, &newInsert.ValuesQuery, &newInsert.Returning)
 
 	newInsert.Insert.Table = table
 	newInsert.Insert.Columns = columns
@@ -36,7 +36,6 @@ type insertStatementImpl struct {
 	Insert      jet.ClauseInsert
 	ValuesQuery jet.ClauseValuesQuery
 	Returning   clauseReturning
-	OnConflict  onConflictClause
 }
 
 func (i *insertStatementImpl) VALUES(value interface{}, values ...interface{}) InsertStatement {
@@ -63,11 +62,3 @@ func (i *insertStatementImpl) QUERY(selectStatement SelectStatement) InsertState
 	i.ValuesQuery.Query = selectStatement
 	return i
 }
-
-func (i *insertStatementImpl) ON_CONFLICT(indexExpressions ...jet.ColumnExpression) onConflict {
-	i.OnConflict = onConflictClause{
-		insertStatement:  i,
-		indexExpressions: indexExpressions,
-	}
-	return &i.OnConflict
-}
diff --git a/postgres/table.go b/postgres/table.go
index bc2f5c2..dc0b266 100644
--- a/postgres/table.go
+++ b/postgres/table.go
@@ -109,10 +109,10 @@ type tableImpl struct {
 }
 
 // NewTable creates new table with schema Name, table Name and list of columns
-func NewTable(schemaName, name string, columns ...jet.ColumnExpression) Table {
+func NewTable(schemaName, name string, column jet.ColumnExpression, columns ...jet.ColumnExpression) Table {
 
 	t := &tableImpl{
-		SerializerTable: jet.NewTable(schemaName, name, columns...),
+		SerializerTable: jet.NewTable(schemaName, name, column, columns...),
 	}
 
 	t.readableTableInterfaceImpl.parent = t
diff --git a/postgres/update_statement.go b/postgres/update_statement.go
index d96e1e9..6d54eb5 100644
--- a/postgres/update_statement.go
+++ b/postgres/update_statement.go
@@ -61,7 +61,7 @@ type clauseSet struct {
 	Values  []jet.Serializer
 }
 
-func (s *clauseSet) Serialize(statementType jet.StatementType, out *jet.SQLBuilder, options ...jet.SerializeOption) {
+func (s *clauseSet) Serialize(statementType jet.StatementType, out *jet.SQLBuilder) {
 	out.NewLine()
 	out.WriteString("SET")
 


Test patch:
diff --git a/internal/jet/sql_builder_test.go b/internal/jet/sql_builder_test.go
index 911df27..f7b5ade 100644
--- a/internal/jet/sql_builder_test.go
+++ b/internal/jet/sql_builder_test.go
@@ -41,9 +41,3 @@ func TestArgToString(t *testing.T) {
 		argToString(map[string]bool{})
 	}()
 }
-
-func TestFallTrough(t *testing.T) {
-	assert.Equal(t, FallTrough([]SerializeOption{ShortName}), []SerializeOption{ShortName})
-	assert.Equal(t, FallTrough([]SerializeOption{SkipNewLine}), []SerializeOption(nil))
-	assert.Equal(t, FallTrough([]SerializeOption{ShortName, SkipNewLine}), []SerializeOption{ShortName})
-}
diff --git a/internal/testutils/test_utils.go b/internal/testutils/test_utils.go
index 8673ff4..f0c18e9 100644
--- a/internal/testutils/test_utils.go
+++ b/internal/testutils/test_utils.go
@@ -8,7 +8,6 @@ import (
 	"github.com/go-jet/jet/internal/utils"
 	"github.com/go-jet/jet/qrm"
 	"github.com/stretchr/testify/assert"
-	"github.com/stretchr/testify/require"
 	"io/ioutil"
 	"os"
 	"path/filepath"
@@ -111,17 +110,17 @@ func AssertDebugStatementSql(t *testing.T, query jet.Statement, expectedQuery st
 	_, args := query.Sql()
 
 	if len(expectedArgs) > 0 {
-		AssertDeepEqual(t, args, expectedArgs, "arguments are not equal")
+		AssertDeepEqual(t, args, expectedArgs)
 	}
 
 	debuqSql := query.DebugSql()
 	assert.Equal(t, debuqSql, expectedQuery)
 }
 
-// AssertSerialize checks if clause serialize produces expected query and args
-func AssertSerialize(t *testing.T, dialect jet.Dialect, serializer jet.Serializer, query string, args ...interface{}) {
+// AssertClauseSerialize checks if clause serialize produces expected query and args
+func AssertClauseSerialize(t *testing.T, dialect jet.Dialect, clause jet.Serializer, query string, args ...interface{}) {
 	out := jet.SQLBuilder{Dialect: dialect}
-	jet.Serialize(serializer, jet.SelectStatementType, &out)
+	jet.Serialize(clause, jet.SelectStatementType, &out)
 
 	//fmt.Println(out.Buff.String())
 
@@ -132,20 +131,8 @@ func AssertSerialize(t *testing.T, dialect jet.Dialect, serializer jet.Serialize
 	}
 }
 
-// AssertClauseSerialize checks if clause serialize produces expected query and args
-func AssertClauseSerialize(t *testing.T, dialect jet.Dialect, clause jet.Clause, query string, args ...interface{}) {
-	out := jet.SQLBuilder{Dialect: dialect}
-	clause.Serialize(jet.SelectStatementType, &out)
-
-	require.Equal(t, out.Buff.String(), query)
-
-	if len(args) > 0 {
-		AssertDeepEqual(t, out.Args, args)
-	}
-}
-
-// AssertDebugSerialize checks if clause serialize produces expected debug query and args
-func AssertDebugSerialize(t *testing.T, dialect jet.Dialect, clause jet.Serializer, query string, args ...interface{}) {
+// AssertDebugClauseSerialize checks if clause serialize produces expected debug query and args
+func AssertDebugClauseSerialize(t *testing.T, dialect jet.Dialect, clause jet.Serializer, query string, args ...interface{}) {
 	out := jet.SQLBuilder{Dialect: dialect, Debug: true}
 	jet.Serialize(clause, jet.SelectStatementType, &out)
 
@@ -166,8 +153,8 @@ func AssertPanicErr(t *testing.T, fun func(), errorStr string) {
 	fun()
 }
 
-// AssertSerializeErr check if clause serialize panics with errString
-func AssertSerializeErr(t *testing.T, dialect jet.Dialect, clause jet.Serializer, errString string) {
+// AssertClauseSerializeErr check if clause serialize panics with errString
+func AssertClauseSerializeErr(t *testing.T, dialect jet.Dialect, clause jet.Serializer, errString string) {
 	defer func() {
 		r := recover()
 		assert.Equal(t, r, errString)
@@ -197,12 +184,16 @@ func AssertQueryPanicErr(t *testing.T, stmt jet.Statement, db qrm.DB, dest inter
 }
 
 // AssertFileContent check if file content at filePath contains expectedContent text.
-func AssertFileContent(t *testing.T, filePath string, expectedContent string) {
+func AssertFileContent(t *testing.T, filePath string, contentBegin string, expectedContent string) {
 	enumFileData, err := ioutil.ReadFile(filePath)
 
-	require.NoError(t, err)
+	assert.NoError(t, err)
+
+	beginIndex := bytes.Index(enumFileData, []byte(contentBegin))
+
+	//fmt.Println("-"+string(enumFileData[beginIndex:])+"-")
 
-	require.Equal(t, "\n"+string(enumFileData), expectedContent)
+	AssertDeepEqual(t, string(enumFileData[beginIndex:]), expectedContent)
 }
 
 // AssertFileNamesEqual check if all filesInfos are contained in fileNames
@@ -221,6 +212,6 @@ func AssertFileNamesEqual(t *testing.T, fileInfos []os.FileInfo, fileNames ...st
 }
 
 // AssertDeepEqual checks if actual and expected objects are deeply equal.
-func AssertDeepEqual(t *testing.T, actual, expected interface{}, msg ...string) {
-	assert.True(t, cmp.Equal(actual, expected), msg)
+func AssertDeepEqual(t *testing.T, actual, expected interface{}) {
+	assert.True(t, cmp.Equal(actual, expected))
 }
diff --git a/mysql/insert_statement_test.go b/mysql/insert_statement_test.go
index 65c8fba..6faf313 100644
--- a/mysql/insert_statement_test.go
+++ b/mysql/insert_statement_test.go
@@ -13,15 +13,15 @@ func TestInvalidInsert(t *testing.T) {
 
 func TestInsertNilValue(t *testing.T) {
 	assertStatementSql(t, table1.INSERT(table1Col1).VALUES(nil), `
-INSERT INTO db.table1 (col1)
-VALUES (?);
+INSERT INTO db.table1 (col1) VALUES
+     (?);
 `, nil)
 }
 
 func TestInsertSingleValue(t *testing.T) {
 	assertStatementSql(t, table1.INSERT(table1Col1).VALUES(1), `
-INSERT INTO db.table1 (col1)
-VALUES (?);
+INSERT INTO db.table1 (col1) VALUES
+     (?);
 `, int(1))
 }
 
@@ -31,8 +31,8 @@ func TestInsertWithColumnList(t *testing.T) {
 	columnList = append(columnList, table3StrCol)
 
 	assertStatementSql(t, table3.INSERT(columnList).VALUES(1, 3), `
-INSERT INTO db.table3 (col_int, col2)
-VALUES (?, ?);
+INSERT INTO db.table3 (col_int, col2) VALUES
+     (?, ?);
 `, 1, 3)
 }
 
@@ -40,15 +40,15 @@ func TestInsertDate(t *testing.T) {
 	date := time.Date(1999, 1, 2, 3, 4, 5, 0, time.UTC)
 
 	assertStatementSql(t, table1.INSERT(table1ColTimestamp).VALUES(date), `
-INSERT INTO db.table1 (col_timestamp)
-VALUES (?);
+INSERT INTO db.table1 (col_timestamp) VALUES
+     (?);
 `, date)
 }
 
 func TestInsertMultipleValues(t *testing.T) {
 	assertStatementSql(t, table1.INSERT(table1Col1, table1ColFloat, table1Col3).VALUES(1, 2, 3), `
-INSERT INTO db.table1 (col1, col_float, col3)
-VALUES (?, ?, ?);
+INSERT INTO db.table1 (col1, col_float, col3) VALUES
+     (?, ?, ?);
 `, 1, 2, 3)
 }
 
@@ -59,10 +59,10 @@ func TestInsertMultipleRows(t *testing.T) {
 		VALUES(111, 222)
 
 	assertStatementSql(t, stmt, `
-INSERT INTO db.table1 (col1, col_float)
-VALUES (?, ?),
-       (?, ?),
-       (?, ?);
+INSERT INTO db.table1 (col1, col_float) VALUES
+     (?, ?),
+     (?, ?),
+     (?, ?);
 `, 1, 2, 11, 22, 111, 222)
 }
 
@@ -84,9 +84,9 @@ func TestInsertValuesFromModel(t *testing.T) {
 		MODEL(&toInsert)
 
 	expectedSQL := `
-INSERT INTO db.table1 (col1, col_float)
-VALUES (?, ?),
-       (?, ?);
+INSERT INTO db.table1 (col1, col_float) VALUES
+     (?, ?),
+     (?, ?);
 `
 
 	assertStatementSql(t, stmt, expectedSQL, int(1), float64(1.11), int(1), float64(1.11))
@@ -127,8 +127,8 @@ func TestInsertDefaultValue(t *testing.T) {
 		VALUES(DEFAULT, "two")
 
 	var expectedSQL = `
-INSERT INTO db.table1 (col1, col_float)
-VALUES (DEFAULT, ?);
+INSERT INTO db.table1 (col1, col_float) VALUES
+     (DEFAULT, ?);
 `
 
 	assertStatementSql(t, stmt, expectedSQL, "two")
diff --git a/mysql/table_test.go b/mysql/table_test.go
index 3bc79f9..3894378 100644
--- a/mysql/table_test.go
+++ b/mysql/table_test.go
@@ -5,9 +5,9 @@ import (
 )
 
 func TestJoinNilInputs(t *testing.T) {
-	assertSerializeErr(t, table2.INNER_JOIN(nil, table1ColBool.EQ(table2ColBool)),
+	assertClauseSerializeErr(t, table2.INNER_JOIN(nil, table1ColBool.EQ(table2ColBool)),
 		"jet: right hand side of join operation is nil table")
-	assertSerializeErr(t, table2.INNER_JOIN(table1, nil),
+	assertClauseSerializeErr(t, table2.INNER_JOIN(table1, nil),
 		"jet: join condition is nil")
 }
 
diff --git a/mysql/utils_test.go b/mysql/utils_test.go
index 709097d..1cc42f1 100644
--- a/mysql/utils_test.go
+++ b/mysql/utils_test.go
@@ -59,15 +59,15 @@ var table3 = NewTable(
 	table3StrCol)
 
 func assertSerialize(t *testing.T, clause jet.Serializer, query string, args ...interface{}) {
-	testutils.AssertSerialize(t, Dialect, clause, query, args...)
+	testutils.AssertClauseSerialize(t, Dialect, clause, query, args...)
 }
 
 func assertDebugSerialize(t *testing.T, clause jet.Serializer, query string, args ...interface{}) {
-	testutils.AssertDebugSerialize(t, Dialect, clause, query, args...)
+	testutils.AssertDebugClauseSerialize(t, Dialect, clause, query, args...)
 }
 
-func assertSerializeErr(t *testing.T, clause jet.Serializer, errString string) {
-	testutils.AssertSerializeErr(t, Dialect, clause, errString)
+func assertClauseSerializeErr(t *testing.T, clause jet.Serializer, errString string) {
+	testutils.AssertClauseSerializeErr(t, Dialect, clause, errString)
 }
 
 func assertProjectionSerialize(t *testing.T, projection jet.Projection, query string, args ...interface{}) {
diff --git a/postgres/clause_test.go b/postgres/clause_test.go
deleted file mode 100644
index 7f64c61..0000000
--- a/postgres/clause_test.go
+++ /dev/null
@@ -1,34 +0,0 @@
-package postgres
-
-import "testing"
-
-func TestOnConflict(t *testing.T) {
-
-	assertClauseSerialize(t, &onConflictClause{}, "")
-
-	onConflict := &onConflictClause{}
-	onConflict.DO_NOTHING()
-	assertClauseSerialize(t, onConflict, "")
-
-	onConflict = &onConflictClause{indexExpressions: ColumnList{table1ColBool}}
-	onConflict.DO_NOTHING()
-	assertClauseSerialize(t, onConflict, `
-ON CONFLICT (col_bool) DO NOTHING`)
-
-	onConflict = &onConflictClause{indexExpressions: ColumnList{table1ColBool}}
-	onConflict.ON_CONSTRAINT("table_pkey").DO_NOTHING()
-	assertClauseSerialize(t, onConflict, `
-ON CONFLICT (col_bool) ON CONSTRAINT table_pkey DO NOTHING`)
-
-	onConflict = &onConflictClause{indexExpressions: ColumnList{table1ColBool, table2ColFloat}}
-	onConflict.WHERE(table2ColFloat.ADD(table1ColInt).GT(table1ColFloat)).DO_UPDATE(
-		SET(table1ColBool, Bool(true)).
-			SET(table1ColInt, Int(1)).
-			WHERE(table2ColFloat.GT(Float(11.1))),
-	)
-	assertClauseSerialize(t, onConflict, `
-ON CONFLICT (col_bool, col_float) WHERE (col_float + col_int) > col_float DO UPDATE
-       SET col_bool = $1,
-           col_int = $2
-       WHERE table2.col_float > $3`)
-}
diff --git a/postgres/insert_statement_test.go b/postgres/insert_statement_test.go
index d80c1a1..ccb1404 100644
--- a/postgres/insert_statement_test.go
+++ b/postgres/insert_statement_test.go
@@ -1,7 +1,6 @@
 package postgres
 
 import (
-	"github.com/go-jet/jet/internal/jet"
 	"github.com/stretchr/testify/assert"
 	"testing"
 	"time"
@@ -14,15 +13,15 @@ func TestInvalidInsert(t *testing.T) {
 
 func TestInsertNilValue(t *testing.T) {
 	assertStatementSql(t, table1.INSERT(table1Col1).VALUES(nil), `
-INSERT INTO db.table1 (col1)
-VALUES ($1);
+INSERT INTO db.table1 (col1) VALUES
+     ($1);
 `, nil)
 }
 
 func TestInsertSingleValue(t *testing.T) {
 	assertStatementSql(t, table1.INSERT(table1Col1).VALUES(1), `
-INSERT INTO db.table1 (col1)
-VALUES ($1);
+INSERT INTO db.table1 (col1) VALUES
+     ($1);
 `, int(1))
 }
 
@@ -30,8 +29,8 @@ func TestInsertWithColumnList(t *testing.T) {
 	columnList := ColumnList{table3ColInt, table3StrCol}
 
 	assertStatementSql(t, table3.INSERT(columnList).VALUES(1, 3), `
-INSERT INTO db.table3 (col_int, col2)
-VALUES ($1, $2);
+INSERT INTO db.table3 (col_int, col2) VALUES
+     ($1, $2);
 `, 1, 3)
 }
 
@@ -39,15 +38,15 @@ func TestInsertDate(t *testing.T) {
 	date := time.Date(1999, 1, 2, 3, 4, 5, 0, time.UTC)
 
 	assertStatementSql(t, table1.INSERT(table1ColTime).VALUES(date), `
-INSERT INTO db.table1 (col_time)
-VALUES ($1);
+INSERT INTO db.table1 (col_time) VALUES
+     ($1);
 `, date)
 }
 
 func TestInsertMultipleValues(t *testing.T) {
-	assertStatementSql(t, table1.INSERT(table1Col1, table1ColFloat, table1ColBool).VALUES(1, 2, 3), `
-INSERT INTO db.table1 (col1, col_float, col_bool)
-VALUES ($1, $2, $3);
+	assertStatementSql(t, table1.INSERT(table1Col1, table1ColFloat, table1Col3).VALUES(1, 2, 3), `
+INSERT INTO db.table1 (col1, col_float, col3) VALUES
+     ($1, $2, $3);
 `, 1, 2, 3)
 }
 
@@ -58,10 +57,10 @@ func TestInsertMultipleRows(t *testing.T) {
 		VALUES(111, 222)
 
 	assertStatementSql(t, stmt, `
-INSERT INTO db.table1 (col1, col_float)
-VALUES ($1, $2),
-       ($3, $4),
-       ($5, $6);
+INSERT INTO db.table1 (col1, col_float) VALUES
+     ($1, $2),
+     ($3, $4),
+     ($5, $6);
 `, 1, 2, 11, 22, 111, 222)
 }
 
@@ -83,12 +82,12 @@ func TestInsertValuesFromModel(t *testing.T) {
 		MODEL(&toInsert)
 
 	expectedSQL := `
-INSERT INTO db.table1 (col1, col_float)
-VALUES ($1, $2),
-       ($3, $4);
+INSERT INTO db.table1 (col1, col_float) VALUES
+     ($1, $2),
+     ($3, $4);
 `
 
-	assertStatementSql(t, stmt, expectedSQL, 1, float64(1.11), 1, float64(1.11))
+	assertStatementSql(t, stmt, expectedSQL, int(1), float64(1.11), int(1), float64(1.11))
 }
 
 func TestInsertValuesFromModelColumnMismatch(t *testing.T) {
@@ -140,63 +139,9 @@ func TestInsertDefaultValue(t *testing.T) {
 		VALUES(DEFAULT, "two")
 
 	var expectedSQL = `
-INSERT INTO db.table1 (col1, col_float)
-VALUES (DEFAULT, $1);
+INSERT INTO db.table1 (col1, col_float) VALUES
+     (DEFAULT, $1);
 `
 
 	assertStatementSql(t, stmt, expectedSQL, "two")
 }
-
-func TestInsert_ON_CONFLICT(t *testing.T) {
-	stmt := table1.INSERT(table1Col1, table1ColBool).
-		VALUES("one", "two").
-		VALUES("1", "2").
-		VALUES("theta", "beta").
-		ON_CONFLICT(table1ColBool).WHERE(table1ColBool.IS_NOT_FALSE()).DO_UPDATE(
-		SET(table1ColBool, "12").
-			SET(table2ColInt, 1).
-			SET(ColumnList{table1Col1, table1ColBool}, jet.ROW(Int(2), String("two"))).
-			WHERE(table1Col1.GT(Int(2))),
-	).
-		RETURNING(table1Col1, table1ColBool)
-
-	assertDebugStatementSql(t, stmt, `
-INSERT INTO db.table1 (col1, col_bool)
-VALUES ('one', 'two'),
-       ('1', '2'),
-       ('theta', 'beta')
-ON CONFLICT (col_bool) WHERE col_bool IS NOT FALSE DO UPDATE
-       SET col_bool = '12',
-           col_int = 1,
-           (col1, col_bool) = ROW(2, 'two')
-       WHERE table1.col1 > 2
-RETURNING table1.col1 AS "table1.col1",
-          table1.col_bool AS "table1.col_bool";
-`)
-}
-
-func TestInsert_ON_CONFLICT_ON_CONSTRAINT(t *testing.T) {
-	stmt := table1.INSERT(table1Col1, table1ColBool).
-		VALUES("one", "two").
-		VALUES("1", "2").
-		ON_CONFLICT().ON_CONSTRAINT("idk_primary_key").DO_UPDATE(
-		SET(table1ColBool, "12").
-			SET(table2ColInt, 1).
-			SET(ColumnList{table1Col1, table1ColBool}, jet.ROW(Int(2), String("two"))).
-			WHERE(table1Col1.GT(Int(2))),
-	).
-		RETURNING(table1Col1, table1ColBool)
-
-	assertDebugStatementSql(t, stmt, `
-INSERT INTO db.table1 (col1, col_bool)
-VALUES ('one', 'two'),
-       ('1', '2')
-ON CONFLICT ON CONSTRAINT idk_primary_key DO UPDATE
-       SET col_bool = '12',
-           col_int = 1,
-           (col1, col_bool) = ROW(2, 'two')
-       WHERE table1.col1 > 2
-RETURNING table1.col1 AS "table1.col1",
-          table1.col_bool AS "table1.col_bool";
-`)
-}
diff --git a/postgres/table_test.go b/postgres/table_test.go
index 3b6f498..43aa096 100644
--- a/postgres/table_test.go
+++ b/postgres/table_test.go
@@ -5,9 +5,9 @@ import (
 )
 
 func TestJoinNilInputs(t *testing.T) {
-	assertSerializeErr(t, table2.INNER_JOIN(nil, table1ColBool.EQ(table2ColBool)),
+	assertClauseSerializeErr(t, table2.INNER_JOIN(nil, table1ColBool.EQ(table2ColBool)),
 		"jet: right hand side of join operation is nil table")
-	assertSerializeErr(t, table2.INNER_JOIN(table1, nil),
+	assertClauseSerializeErr(t, table2.INNER_JOIN(table1, nil),
 		"jet: join condition is nil")
 }
 
diff --git a/postgres/utils_test.go b/postgres/utils_test.go
index cbca2bc..38c429c 100644
--- a/postgres/utils_test.go
+++ b/postgres/utils_test.go
@@ -10,6 +10,7 @@ import (
 var table1Col1 = IntegerColumn("col1")
 var table1ColInt = IntegerColumn("col_int")
 var table1ColFloat = FloatColumn("col_float")
+var table1Col3 = IntegerColumn("col3")
 var table1ColTime = TimeColumn("col_time")
 var table1ColTimez = TimezColumn("col_timez")
 var table1ColTimestamp = TimestampColumn("col_timestamp")
@@ -24,6 +25,7 @@ var table1 = NewTable(
 	table1Col1,
 	table1ColInt,
 	table1ColFloat,
+	table1Col3,
 	table1ColTime,
 	table1ColTimez,
 	table1ColBool,
@@ -73,16 +75,12 @@ var table3 = NewTable(
 	table3ColInt,
 	table3StrCol)
 
-func assertSerialize(t *testing.T, serializer jet.Serializer, query string, args ...interface{}) {
-	testutils.AssertSerialize(t, Dialect, serializer, query, args...)
-}
-
-func assertClauseSerialize(t *testing.T, clause jet.Clause, query string, args ...interface{}) {
+func assertSerialize(t *testing.T, clause jet.Serializer, query string, args ...interface{}) {
 	testutils.AssertClauseSerialize(t, Dialect, clause, query, args...)
 }
 
-func assertSerializeErr(t *testing.T, serializer jet.Serializer, errString string) {
-	testutils.AssertSerializeErr(t, Dialect, serializer, errString)
+func assertClauseSerializeErr(t *testing.T, clause jet.Serializer, errString string) {
+	testutils.AssertClauseSerializeErr(t, Dialect, clause, errString)
 }
 
 func assertProjectionSerialize(t *testing.T, projection jet.Projection, query string, args ...interface{}) {
@@ -90,6 +88,5 @@ func assertProjectionSerialize(t *testing.T, projection jet.Projection, query st
 }
 
 var assertStatementSql = testutils.AssertStatementSql
-var assertDebugStatementSql = testutils.AssertDebugStatementSql
 var assertStatementSqlErr = testutils.AssertStatementSqlErr
 var assertPanicErr = testutils.AssertPanicErr
diff --git a/tests/mysql/generator_test.go b/tests/mysql/generator_test.go
index f28c5c1..8ae9347 100644
--- a/tests/mysql/generator_test.go
+++ b/tests/mysql/generator_test.go
@@ -67,7 +67,7 @@ func assertGeneratedFiles(t *testing.T) {
 		"customer.go", "film.go", "film_actor.go", "film_category.go", "film_text.go", "inventory.go", "language.go",
 		"payment.go", "rental.go", "staff.go", "store.go")
 
-	testutils.AssertFileContent(t, genTestDir3+"/dvds/table/actor.go", actorSQLBuilderFile)
+	testutils.AssertFileContent(t, genTestDir3+"/dvds/table/actor.go", "\npackage table", actorSQLBuilderFile)
 
 	// View SQL Builder files
 	viewSQLBuilderFiles, err := ioutil.ReadDir(genTestDir3 + "/dvds/view")
@@ -76,14 +76,14 @@ func assertGeneratedFiles(t *testing.T) {
 	testutils.AssertFileNamesEqual(t, viewSQLBuilderFiles, "actor_info.go", "film_list.go", "nicer_but_slower_film_list.go",
 		"sales_by_film_category.go", "customer_list.go", "sales_by_store.go", "staff_list.go")
 
-	testutils.AssertFileContent(t, genTestDir3+"/dvds/view/actor_info.go", actorInfoSQLBuilderFile)
+	testutils.AssertFileContent(t, genTestDir3+"/dvds/view/actor_info.go", "\npackage view", actorInfoSQLBuilerFile)
 
 	// Enums SQL Builder files
 	enumFiles, err := ioutil.ReadDir(genTestDir3 + "/dvds/enum")
 	assert.NoError(t, err)
 
 	testutils.AssertFileNamesEqual(t, enumFiles, "film_rating.go", "film_list_rating.go", "nicer_but_slower_film_list_rating.go")
-	testutils.AssertFileContent(t, genTestDir3+"/dvds/enum/film_rating.go", mpaaRatingEnumFile)
+	testutils.AssertFileContent(t, genTestDir3+"/dvds/enum/film_rating.go", "\npackage enum", mpaaRatingEnumFile)
 
 	// Model files
 	modelFiles, err := ioutil.ReadDir(genTestDir3 + "/dvds/model")
@@ -96,17 +96,10 @@ func assertGeneratedFiles(t *testing.T) {
 		"actor_info.go", "film_list.go", "nicer_but_slower_film_list.go", "sales_by_film_category.go",
 		"customer_list.go", "sales_by_store.go", "staff_list.go")
 
-	testutils.AssertFileContent(t, genTestDir3+"/dvds/model/actor.go", actorModelFile)
+	testutils.AssertFileContent(t, genTestDir3+"/dvds/model/actor.go", "\npackage model", actorModelFile)
 }
 
 var mpaaRatingEnumFile = `
-//
-// Code generated by go-jet DO NOT EDIT.
-//
-// WARNING: Changes to this file may cause incorrect behavior
-// and will be lost if the code is regenerated
-//
-
 package enum
 
 import "github.com/go-jet/jet/mysql"
@@ -127,13 +120,6 @@ var FilmRating = &struct {
 `
 
 var actorSQLBuilderFile = `
-//
-// Code generated by go-jet DO NOT EDIT.
-//
-// WARNING: Changes to this file may cause incorrect behavior
-// and will be lost if the code is regenerated
-//
-
 package table
 
 import (
@@ -142,7 +128,7 @@ import (
 
 var Actor = newActorTable()
 
-type actorTable struct {
+type ActorTable struct {
 	mysql.Table
 
 	//Columns
@@ -155,38 +141,25 @@ type actorTable struct {
 	MutableColumns mysql.ColumnList
 }
 
-type ActorTable struct {
-	actorTable
-
-	EXCLUDED actorTable
-}
-
 // creates new ActorTable with assigned alias
 func (a *ActorTable) AS(alias string) *ActorTable {
 	aliasTable := newActorTable()
+
 	aliasTable.Table.AS(alias)
+
 	return aliasTable
 }
 
 func newActorTable() *ActorTable {
-	return &ActorTable{
-		actorTable: newActorTableImpl("dvds", "actor"),
-		EXCLUDED:   newActorTableImpl("", "excluded"),
-	}
-}
-
-func newActorTableImpl(schemaName, tableName string) actorTable {
 	var (
 		ActorIDColumn    = mysql.IntegerColumn("actor_id")
 		FirstNameColumn  = mysql.StringColumn("first_name")
 		LastNameColumn   = mysql.StringColumn("last_name")
 		LastUpdateColumn = mysql.TimestampColumn("last_update")
-		allColumns       = mysql.ColumnList{ActorIDColumn, FirstNameColumn, LastNameColumn, LastUpdateColumn}
-		mutableColumns   = mysql.ColumnList{FirstNameColumn, LastNameColumn, LastUpdateColumn}
 	)
 
-	return actorTable{
-		Table: mysql.NewTable(schemaName, tableName, allColumns...),
+	return &ActorTable{
+		Table: mysql.NewTable("dvds", "actor", ActorIDColumn, FirstNameColumn, LastNameColumn, LastUpdateColumn),
 
 		//Columns
 		ActorID:    ActorIDColumn,
@@ -194,20 +167,13 @@ func newActorTableImpl(schemaName, tableName string) actorTable {
 		LastName:   LastNameColumn,
 		LastUpdate: LastUpdateColumn,
 
-		AllColumns:     allColumns,
-		MutableColumns: mutableColumns,
+		AllColumns:     mysql.ColumnList{ActorIDColumn, FirstNameColumn, LastNameColumn, LastUpdateColumn},
+		MutableColumns: mysql.ColumnList{FirstNameColumn, LastNameColumn, LastUpdateColumn},
 	}
 }
 `
 
 var actorModelFile = `
-//
-// Code generated by go-jet DO NOT EDIT.
-//
-// WARNING: Changes to this file may cause incorrect behavior
-// and will be lost if the code is regenerated
-//
-
 package model
 
 import (
@@ -222,14 +188,7 @@ type Actor struct {
 }
 `
 
-var actorInfoSQLBuilderFile = `
-//
-// Code generated by go-jet DO NOT EDIT.
-//
-// WARNING: Changes to this file may cause incorrect behavior
-// and will be lost if the code is regenerated
-//
-
+var actorInfoSQLBuilerFile = `
 package view
 
 import (
@@ -238,7 +197,7 @@ import (
 
 var ActorInfo = newActorInfoTable()
 
-type actorInfoTable struct {
+type ActorInfoTable struct {
 	mysql.Table
 
 	//Columns
@@ -251,38 +210,25 @@ type actorInfoTable struct {
 	MutableColumns mysql.ColumnList
 }
 
-type ActorInfoTable struct {
-	actorInfoTable
-
-	EXCLUDED actorInfoTable
-}
-
 // creates new ActorInfoTable with assigned alias
 func (a *ActorInfoTable) AS(alias string) *ActorInfoTable {
 	aliasTable := newActorInfoTable()
+
 	aliasTable.Table.AS(alias)
+
 	return aliasTable
 }
 
 func newActorInfoTable() *ActorInfoTable {
-	return &ActorInfoTable{
-		actorInfoTable: newActorInfoTableImpl("dvds", "actor_info"),
-		EXCLUDED:       newActorInfoTableImpl("", "excluded"),
-	}
-}
-
-func newActorInfoTableImpl(schemaName, tableName string) actorInfoTable {
 	var (
 		ActorIDColumn   = mysql.IntegerColumn("actor_id")
 		FirstNameColumn = mysql.StringColumn("first_name")
 		LastNameColumn  = mysql.StringColumn("last_name")
 		FilmInfoColumn  = mysql.StringColumn("film_info")
-		allColumns      = mysql.ColumnList{ActorIDColumn, FirstNameColumn, LastNameColumn, FilmInfoColumn}
-		mutableColumns  = mysql.ColumnList{ActorIDColumn, FirstNameColumn, LastNameColumn, FilmInfoColumn}
 	)
 
-	return actorInfoTable{
-		Table: mysql.NewTable(schemaName, tableName, allColumns...),
+	return &ActorInfoTable{
+		Table: mysql.NewTable("dvds", "actor_info", ActorIDColumn, FirstNameColumn, LastNameColumn, FilmInfoColumn),
 
 		//Columns
 		ActorID:   ActorIDColumn,
@@ -290,8 +236,8 @@ func newActorInfoTableImpl(schemaName, tableName string) actorInfoTable {
 		LastName:  LastNameColumn,
 		FilmInfo:  FilmInfoColumn,
 
-		AllColumns:     allColumns,
-		MutableColumns: mutableColumns,
+		AllColumns:     mysql.ColumnList{ActorIDColumn, FirstNameColumn, LastNameColumn, FilmInfoColumn},
+		MutableColumns: mysql.ColumnList{ActorIDColumn, FirstNameColumn, LastNameColumn, FilmInfoColumn},
 	}
 }
 `
diff --git a/tests/mysql/insert_test.go b/tests/mysql/insert_test.go
index cb27f61..4c86012 100644
--- a/tests/mysql/insert_test.go
+++ b/tests/mysql/insert_test.go
@@ -15,10 +15,10 @@ func TestInsertValues(t *testing.T) {
 	cleanUpLinkTable(t)
 
 	var expectedSQL = `
-INSERT INTO test_sample.link (id, url, name, description)
-VALUES (100, 'http://www.postgresqltutorial.com', 'PostgreSQL Tutorial', DEFAULT),
-       (101, 'http://www.google.com', 'Google', DEFAULT),
-       (102, 'http://www.yahoo.com', 'Yahoo', NULL);
+INSERT INTO test_sample.link (id, url, name, description) VALUES
+     (100, 'http://www.postgresqltutorial.com', 'PostgreSQL Tutorial', DEFAULT),
+     (101, 'http://www.google.com', 'Google', DEFAULT),
+     (102, 'http://www.yahoo.com', 'Yahoo', NULL);
 `
 
 	insertQuery := Link.INSERT(Link.ID, Link.URL, Link.Name, Link.Description).
@@ -69,8 +69,8 @@ func TestInsertEmptyColumnList(t *testing.T) {
 	cleanUpLinkTable(t)
 
 	expectedSQL := `
-INSERT INTO test_sample.link
-VALUES (100, 'http://www.postgresqltutorial.com', 'PostgreSQL Tutorial', DEFAULT);
+INSERT INTO test_sample.link VALUES
+     (100, 'http://www.postgresqltutorial.com', 'PostgreSQL Tutorial', DEFAULT);
 `
 
 	stmt := Link.INSERT().
@@ -97,8 +97,8 @@ VALUES (100, 'http://www.postgresqltutorial.com', 'PostgreSQL Tutorial', DEFAULT
 func TestInsertModelObject(t *testing.T) {
 	cleanUpLinkTable(t)
 	var expectedSQL = `
-INSERT INTO test_sample.link (url, name)
-VALUES ('http://www.duckduckgo.com', 'Duck Duck go');
+INSERT INTO test_sample.link (url, name) VALUES
+     ('http://www.duckduckgo.com', 'Duck Duck go');
 `
 
 	linkData := model.Link{
@@ -119,8 +119,8 @@ VALUES ('http://www.duckduckgo.com', 'Duck Duck go');
 func TestInsertModelObjectEmptyColumnList(t *testing.T) {
 	cleanUpLinkTable(t)
 	var expectedSQL = `
-INSERT INTO test_sample.link
-VALUES (1000, 'http://www.duckduckgo.com', 'Duck Duck go', NULL);
+INSERT INTO test_sample.link VALUES
+     (1000, 'http://www.duckduckgo.com', 'Duck Duck go', NULL);
 `
 
 	linkData := model.Link{
@@ -141,10 +141,10 @@ VALUES (1000, 'http://www.duckduckgo.com', 'Duck Duck go', NULL);
 
 func TestInsertModelsObject(t *testing.T) {
 	expectedSQL := `
-INSERT INTO test_sample.link (url, name)
-VALUES ('http://www.postgresqltutorial.com', 'PostgreSQL Tutorial'),
-       ('http://www.google.com', 'Google'),
-       ('http://www.yahoo.com', 'Yahoo');
+INSERT INTO test_sample.link (url, name) VALUES
+     ('http://www.postgresqltutorial.com', 'PostgreSQL Tutorial'),
+     ('http://www.google.com', 'Google'),
+     ('http://www.yahoo.com', 'Yahoo');
 `
 
 	tutorial := model.Link{
@@ -177,11 +177,11 @@ VALUES ('http://www.postgresqltutorial.com', 'PostgreSQL Tutorial'),
 
 func TestInsertUsingMutableColumns(t *testing.T) {
 	var expectedSQL = `
-INSERT INTO test_sample.link (url, name, description)
-VALUES ('http://www.postgresqltutorial.com', 'PostgreSQL Tutorial', DEFAULT),
-       ('http://www.google.com', 'Google', NULL),
-       ('http://www.google.com', 'Google', NULL),
-       ('http://www.yahoo.com', 'Yahoo', NULL);
+INSERT INTO test_sample.link (url, name, description) VALUES
+     ('http://www.postgresqltutorial.com', 'PostgreSQL Tutorial', DEFAULT),
+     ('http://www.google.com', 'Google', NULL),
+     ('http://www.google.com', 'Google', NULL),
+     ('http://www.yahoo.com', 'Yahoo', NULL);
 `
 
 	google := model.Link{
diff --git a/tests/postgres/generator_test.go b/tests/postgres/generator_test.go
index a9e771d..54d7cc4 100644
--- a/tests/postgres/generator_test.go
+++ b/tests/postgres/generator_test.go
@@ -101,7 +101,7 @@ func assertGeneratedFiles(t *testing.T) {
 		"customer.go", "film.go", "film_actor.go", "film_category.go", "inventory.go", "language.go",
 		"payment.go", "rental.go", "staff.go", "store.go")
 
-	testutils.AssertFileContent(t, "./.gentestdata2/jetdb/dvds/table/actor.go", actorSQLBuilderFile)
+	testutils.AssertFileContent(t, "./.gentestdata2/jetdb/dvds/table/actor.go", "\npackage table", actorSQLBuilderFile)
 
 	// View SQL Builder files
 	viewSQLBuilderFiles, err := ioutil.ReadDir("./.gentestdata2/jetdb/dvds/view")
@@ -110,14 +110,14 @@ func assertGeneratedFiles(t *testing.T) {
 	testutils.AssertFileNamesEqual(t, viewSQLBuilderFiles, "actor_info.go", "film_list.go", "nicer_but_slower_film_list.go",
 		"sales_by_film_category.go", "customer_list.go", "sales_by_store.go", "staff_list.go")
 
-	testutils.AssertFileContent(t, "./.gentestdata2/jetdb/dvds/view/actor_info.go", actorInfoSQLBuilderFile)
+	testutils.AssertFileContent(t, "./.gentestdata2/jetdb/dvds/view/actor_info.go", "\npackage view", actorInfoSQLBuilderFile)
 
 	// Enums SQL Builder files
 	enumFiles, err := ioutil.ReadDir("./.gentestdata2/jetdb/dvds/enum")
 	assert.NoError(t, err)
 
 	testutils.AssertFileNamesEqual(t, enumFiles, "mpaa_rating.go")
-	testutils.AssertFileContent(t, "./.gentestdata2/jetdb/dvds/enum/mpaa_rating.go", mpaaRatingEnumFile)
+	testutils.AssertFileContent(t, "./.gentestdata2/jetdb/dvds/enum/mpaa_rating.go", "\npackage enum", mpaaRatingEnumFile)
 
 	// Model files
 	modelFiles, err := ioutil.ReadDir("./.gentestdata2/jetdb/dvds/model")
@@ -129,17 +129,10 @@ func assertGeneratedFiles(t *testing.T) {
 		"actor_info.go", "film_list.go", "nicer_but_slower_film_list.go", "sales_by_film_category.go",
 		"customer_list.go", "sales_by_store.go", "staff_list.go")
 
-	testutils.AssertFileContent(t, "./.gentestdata2/jetdb/dvds/model/actor.go", actorModelFile)
+	testutils.AssertFileContent(t, "./.gentestdata2/jetdb/dvds/model/actor.go", "\npackage model", actorModelFile)
 }
 
 var mpaaRatingEnumFile = `
-//
-// Code generated by go-jet DO NOT EDIT.
-//
-// WARNING: Changes to this file may cause incorrect behavior
-// and will be lost if the code is regenerated
-//
-
 package enum
 
 import "github.com/go-jet/jet/postgres"
@@ -160,13 +153,6 @@ var MpaaRating = &struct {
 `
 
 var actorSQLBuilderFile = `
-//
-// Code generated by go-jet DO NOT EDIT.
-//
-// WARNING: Changes to this file may cause incorrect behavior
-// and will be lost if the code is regenerated
-//
-
 package table
 
 import (
@@ -175,7 +161,7 @@ import (
 
 var Actor = newActorTable()
 
-type actorTable struct {
+type ActorTable struct {
 	postgres.Table
 
 	//Columns
@@ -188,38 +174,25 @@ type actorTable struct {
 	MutableColumns postgres.ColumnList
 }
 
-type ActorTable struct {
-	actorTable
-
-	EXCLUDED actorTable
-}
-
 // creates new ActorTable with assigned alias
 func (a *ActorTable) AS(alias string) *ActorTable {
 	aliasTable := newActorTable()
+
 	aliasTable.Table.AS(alias)
+
 	return aliasTable
 }
 
 func newActorTable() *ActorTable {
-	return &ActorTable{
-		actorTable: newActorTableImpl("dvds", "actor"),
-		EXCLUDED:   newActorTableImpl("", "excluded"),
-	}
-}
-
-func newActorTableImpl(schemaName, tableName string) actorTable {
 	var (
 		ActorIDColumn    = postgres.IntegerColumn("actor_id")
 		FirstNameColumn  = postgres.StringColumn("first_name")
 		LastNameColumn   = postgres.StringColumn("last_name")
 		LastUpdateColumn = postgres.TimestampColumn("last_update")
-		allColumns       = postgres.ColumnList{ActorIDColumn, FirstNameColumn, LastNameColumn, LastUpdateColumn}
-		mutableColumns   = postgres.ColumnList{FirstNameColumn, LastNameColumn, LastUpdateColumn}
 	)
 
-	return actorTable{
-		Table: postgres.NewTable(schemaName, tableName, allColumns...),
+	return &ActorTable{
+		Table: postgres.NewTable("dvds", "actor", ActorIDColumn, FirstNameColumn, LastNameColumn, LastUpdateColumn),
 
 		//Columns
 		ActorID:    ActorIDColumn,
@@ -227,20 +200,13 @@ func newActorTableImpl(schemaName, tableName string) actorTable {
 		LastName:   LastNameColumn,
 		LastUpdate: LastUpdateColumn,
 
-		AllColumns:     allColumns,
-		MutableColumns: mutableColumns,
+		AllColumns:     postgres.ColumnList{ActorIDColumn, FirstNameColumn, LastNameColumn, LastUpdateColumn},
+		MutableColumns: postgres.ColumnList{FirstNameColumn, LastNameColumn, LastUpdateColumn},
 	}
 }
 `
 
 var actorModelFile = `
-//
-// Code generated by go-jet DO NOT EDIT.
-//
-// WARNING: Changes to this file may cause incorrect behavior
-// and will be lost if the code is regenerated
-//
-
 package model
 
 import (
@@ -256,13 +222,6 @@ type Actor struct {
 `
 
 var actorInfoSQLBuilderFile = `
-//
-// Code generated by go-jet DO NOT EDIT.
-//
-// WARNING: Changes to this file may cause incorrect behavior
-// and will be lost if the code is regenerated
-//
-
 package view
 
 import (
@@ -271,7 +230,7 @@ import (
 
 var ActorInfo = newActorInfoTable()
 
-type actorInfoTable struct {
+type ActorInfoTable struct {
 	postgres.Table
 
 	//Columns
@@ -284,38 +243,25 @@ type actorInfoTable struct {
 	MutableColumns postgres.ColumnList
 }
 
-type ActorInfoTable struct {
-	actorInfoTable
-
-	EXCLUDED actorInfoTable
-}
-
 // creates new ActorInfoTable with assigned alias
 func (a *ActorInfoTable) AS(alias string) *ActorInfoTable {
 	aliasTable := newActorInfoTable()
+
 	aliasTable.Table.AS(alias)
+
 	return aliasTable
 }
 
 func newActorInfoTable() *ActorInfoTable {
-	return &ActorInfoTable{
-		actorInfoTable: newActorInfoTableImpl("dvds", "actor_info"),
-		EXCLUDED:       newActorInfoTableImpl("", "excluded"),
-	}
-}
-
-func newActorInfoTableImpl(schemaName, tableName string) actorInfoTable {
 	var (
 		ActorIDColumn   = postgres.IntegerColumn("actor_id")
 		FirstNameColumn = postgres.StringColumn("first_name")
 		LastNameColumn  = postgres.StringColumn("last_name")
 		FilmInfoColumn  = postgres.StringColumn("film_info")
-		allColumns      = postgres.ColumnList{ActorIDColumn, FirstNameColumn, LastNameColumn, FilmInfoColumn}
-		mutableColumns  = postgres.ColumnList{ActorIDColumn, FirstNameColumn, LastNameColumn, FilmInfoColumn}
 	)
 
-	return actorInfoTable{
-		Table: postgres.NewTable(schemaName, tableName, allColumns...),
+	return &ActorInfoTable{
+		Table: postgres.NewTable("dvds", "actor_info", ActorIDColumn, FirstNameColumn, LastNameColumn, FilmInfoColumn),
 
 		//Columns
 		ActorID:   ActorIDColumn,
@@ -323,8 +269,8 @@ func newActorInfoTableImpl(schemaName, tableName string) actorInfoTable {
 		LastName:  LastNameColumn,
 		FilmInfo:  FilmInfoColumn,
 
-		AllColumns:     allColumns,
-		MutableColumns: mutableColumns,
+		AllColumns:     postgres.ColumnList{ActorIDColumn, FirstNameColumn, LastNameColumn, FilmInfoColumn},
+		MutableColumns: postgres.ColumnList{ActorIDColumn, FirstNameColumn, LastNameColumn, FilmInfoColumn},
 	}
 }
 `
@@ -338,8 +284,8 @@ func TestGeneratedAllTypesSQLBuilderFiles(t *testing.T) {
 	assert.NoError(t, err)
 
 	testutils.AssertFileNamesEqual(t, enumFiles, "mood.go", "level.go")
-	testutils.AssertFileContent(t, enumDir+"mood.go", moodEnumContent)
-	testutils.AssertFileContent(t, enumDir+"level.go", levelEnumContent)
+	testutils.AssertFileContent(t, enumDir+"mood.go", "\npackage enum", moodEnumContent)
+	testutils.AssertFileContent(t, enumDir+"level.go", "\npackage enum", levelEnumContent)
 
 	modelFiles, err := ioutil.ReadDir(modelDir)
 	assert.NoError(t, err)
@@ -347,7 +293,7 @@ func TestGeneratedAllTypesSQLBuilderFiles(t *testing.T) {
 	testutils.AssertFileNamesEqual(t, modelFiles, "all_types.go", "all_types_view.go", "employee.go", "link.go",
 		"mood.go", "person.go", "person_phone.go", "weird_names_table.go", "level.go", "user.go")
 
-	testutils.AssertFileContent(t, modelDir+"all_types.go", allTypesModelContent)
+	testutils.AssertFileContent(t, modelDir+"all_types.go", "\npackage model", allTypesModelContent)
 
 	tableFiles, err := ioutil.ReadDir(tableDir)
 	assert.NoError(t, err)
@@ -355,17 +301,10 @@ func TestGeneratedAllTypesSQLBuilderFiles(t *testing.T) {
 	testutils.AssertFileNamesEqual(t, tableFiles, "all_types.go", "employee.go", "link.go",
 		"person.go", "person_phone.go", "weird_names_table.go", "user.go")
 
-	testutils.AssertFileContent(t, tableDir+"all_types.go", allTypesTableContent)
+	testutils.AssertFileContent(t, tableDir+"all_types.go", "\npackage table", allTypesTableContent)
 }
 
 var moodEnumContent = `
-//
-// Code generated by go-jet DO NOT EDIT.
-//
-// WARNING: Changes to this file may cause incorrect behavior
-// and will be lost if the code is regenerated
-//
-
 package enum
 
 import "github.com/go-jet/jet/postgres"
@@ -382,13 +321,6 @@ var Mood = &struct {
 `
 
 var levelEnumContent = `
-//
-// Code generated by go-jet DO NOT EDIT.
-//
-// WARNING: Changes to this file may cause incorrect behavior
-// and will be lost if the code is regenerated
-//
-
 package enum
 
 import "github.com/go-jet/jet/postgres"
@@ -409,13 +341,6 @@ var Level = &struct {
 `
 
 var allTypesModelContent = `
-//
-// Code generated by go-jet DO NOT EDIT.
-//
-// WARNING: Changes to this file may cause incorrect behavior
-// and will be lost if the code is regenerated
-//
-
 package model
 
 import (
@@ -489,13 +414,6 @@ type AllTypes struct {
 `
 
 var allTypesTableContent = `
-//
-// Code generated by go-jet DO NOT EDIT.
-//
-// WARNING: Changes to this file may cause incorrect behavior
-// and will be lost if the code is regenerated
-//
-
 package table
 
 import (
@@ -504,7 +422,7 @@ import (
 
 var AllTypes = newAllTypesTable()
 
-type allTypesTable struct {
+type AllTypesTable struct {
 	postgres.Table
 
 	//Columns
@@ -574,27 +492,16 @@ type allTypesTable struct {
 	MutableColumns postgres.ColumnList
 }
 
-type AllTypesTable struct {
-	allTypesTable
-
-	EXCLUDED allTypesTable
-}
-
 // creates new AllTypesTable with assigned alias
 func (a *AllTypesTable) AS(alias string) *AllTypesTable {
 	aliasTable := newAllTypesTable()
+
 	aliasTable.Table.AS(alias)
+
 	return aliasTable
 }
 
 func newAllTypesTable() *AllTypesTable {
-	return &AllTypesTable{
-		allTypesTable: newAllTypesTableImpl("test_sample", "all_types"),
-		EXCLUDED:      newAllTypesTableImpl("", "excluded"),
-	}
-}
-
-func newAllTypesTableImpl(schemaName, tableName string) allTypesTable {
 	var (
 		SmallIntPtrColumn          = postgres.IntegerColumn("small_int_ptr")
 		SmallIntColumn             = postgres.IntegerColumn("small_int")
@@ -657,12 +564,10 @@ func newAllTypesTableImpl(schemaName, tableName string) allTypesTable {
 		JsonbArrayColumn           = postgres.StringColumn("jsonb_array")
 		TextMultiDimArrayPtrColumn = postgres.StringColumn("text_multi_dim_array_ptr")
 		TextMultiDimArrayColumn    = postgres.StringColumn("text_multi_dim_array")
-		allColumns                 = postgres.ColumnList{SmallIntPtrColumn, SmallIntColumn, IntegerPtrColumn, IntegerColumn, BigIntPtrColumn, BigIntColumn, DecimalPtrColumn, DecimalColumn, NumericPtrColumn, NumericColumn, RealPtrColumn, RealColumn, DoublePrecisionPtrColumn, DoublePrecisionColumn, SmallserialColumn, SerialColumn, BigserialColumn, VarCharPtrColumn, VarCharColumn, CharPtrColumn, CharColumn, TextPtrColumn, TextColumn, ByteaPtrColumn, ByteaColumn, TimestampzPtrColumn, TimestampzColumn, TimestampPtrColumn, TimestampColumn, DatePtrColumn, DateColumn, TimezPtrColumn, TimezColumn, TimePtrColumn, TimeColumn, IntervalPtrColumn, IntervalColumn, BooleanPtrColumn, BooleanColumn, PointPtrColumn, BitPtrColumn, BitColumn, BitVaryingPtrColumn, BitVaryingColumn, TsvectorPtrColumn, TsvectorColumn, UUIDPtrColumn, UUIDColumn, XMLPtrColumn, XMLColumn, JSONPtrColumn, JSONColumn, JsonbPtrColumn, JsonbColumn, IntegerArrayPtrColumn, IntegerArrayColumn, TextArrayPtrColumn, TextArrayColumn, JsonbArrayColumn, TextMultiDimArrayPtrColumn, TextMultiDimArrayColumn}
-		mutableColumns             = postgres.ColumnList{SmallIntPtrColumn, SmallIntColumn, IntegerPtrColumn, IntegerColumn, BigIntPtrColumn, BigIntColumn, DecimalPtrColumn, DecimalColumn, NumericPtrColumn, NumericColumn, RealPtrColumn, RealColumn, DoublePrecisionPtrColumn, DoublePrecisionColumn, SmallserialColumn, SerialColumn, BigserialColumn, VarCharPtrColumn, VarCharColumn, CharPtrColumn, CharColumn, TextPtrColumn, TextColumn, ByteaPtrColumn, ByteaColumn, TimestampzPtrColumn, TimestampzColumn, TimestampPtrColumn, TimestampColumn, DatePtrColumn, DateColumn, TimezPtrColumn, TimezColumn, TimePtrColumn, TimeColumn, IntervalPtrColumn, IntervalColumn, BooleanPtrColumn, BooleanColumn, PointPtrColumn, BitPtrColumn, BitColumn, BitVaryingPtrColumn, BitVaryingColumn, TsvectorPtrColumn, TsvectorColumn, UUIDPtrColumn, UUIDColumn, XMLPtrColumn, XMLColumn, JSONPtrColumn, JSONColumn, JsonbPtrColumn, JsonbColumn, IntegerArrayPtrColumn, IntegerArrayColumn, TextArrayPtrColumn, TextArrayColumn, JsonbArrayColumn, TextMultiDimArrayPtrColumn, TextMultiDimArrayColumn}
 	)
 
-	return allTypesTable{
-		Table: postgres.NewTable(schemaName, tableName, allColumns...),
+	return &AllTypesTable{
+		Table: postgres.NewTable("test_sample", "all_types", SmallIntPtrColumn, SmallIntColumn, IntegerPtrColumn, IntegerColumn, BigIntPtrColumn, BigIntColumn, DecimalPtrColumn, DecimalColumn, NumericPtrColumn, NumericColumn, RealPtrColumn, RealColumn, DoublePrecisionPtrColumn, DoublePrecisionColumn, SmallserialColumn, SerialColumn, BigserialColumn, VarCharPtrColumn, VarCharColumn, CharPtrColumn, CharColumn, TextPtrColumn, TextColumn, ByteaPtrColumn, ByteaColumn, TimestampzPtrColumn, TimestampzColumn, TimestampPtrColumn, TimestampColumn, DatePtrColumn, DateColumn, TimezPtrColumn, TimezColumn, TimePtrColumn, TimeColumn, IntervalPtrColumn, IntervalColumn, BooleanPtrColumn, BooleanColumn, PointPtrColumn, BitPtrColumn, BitColumn, BitVaryingPtrColumn, BitVaryingColumn, TsvectorPtrColumn, TsvectorColumn, UUIDPtrColumn, UUIDColumn, XMLPtrColumn, XMLColumn, JSONPtrColumn, JSONColumn, JsonbPtrColumn, JsonbColumn, IntegerArrayPtrColumn, IntegerArrayColumn, TextArrayPtrColumn, TextArrayColumn, JsonbArrayColumn, TextMultiDimArrayPtrColumn, TextMultiDimArrayColumn),
 
 		//Columns
 		SmallIntPtr:          SmallIntPtrColumn,
@@ -727,8 +632,8 @@ func newAllTypesTableImpl(schemaName, tableName string) allTypesTable {
 		TextMultiDimArrayPtr: TextMultiDimArrayPtrColumn,
 		TextMultiDimArray:    TextMultiDimArrayColumn,
 
-		AllColumns:     allColumns,
-		MutableColumns: mutableColumns,
+		AllColumns:     postgres.ColumnList{SmallIntPtrColumn, SmallIntColumn, IntegerPtrColumn, IntegerColumn, BigIntPtrColumn, BigIntColumn, DecimalPtrColumn, DecimalColumn, NumericPtrColumn, NumericColumn, RealPtrColumn, RealColumn, DoublePrecisionPtrColumn, DoublePrecisionColumn, SmallserialColumn, SerialColumn, BigserialColumn, VarCharPtrColumn, VarCharColumn, CharPtrColumn, CharColumn, TextPtrColumn, TextColumn, ByteaPtrColumn, ByteaColumn, TimestampzPtrColumn, TimestampzColumn, TimestampPtrColumn, TimestampColumn, DatePtrColumn, DateColumn, TimezPtrColumn, TimezColumn, TimePtrColumn, TimeColumn, IntervalPtrColumn, IntervalColumn, BooleanPtrColumn, BooleanColumn, PointPtrColumn, BitPtrColumn, BitColumn, BitVaryingPtrColumn, BitVaryingColumn, TsvectorPtrColumn, TsvectorColumn, UUIDPtrColumn, UUIDColumn, XMLPtrColumn, XMLColumn, JSONPtrColumn, JSONColumn, JsonbPtrColumn, JsonbColumn, IntegerArrayPtrColumn, IntegerArrayColumn, TextArrayPtrColumn, TextArrayColumn, JsonbArrayColumn, TextMultiDimArrayPtrColumn, TextMultiDimArrayColumn},
+		MutableColumns: postgres.ColumnList{SmallIntPtrColumn, SmallIntColumn, IntegerPtrColumn, IntegerColumn, BigIntPtrColumn, BigIntColumn, DecimalPtrColumn, DecimalColumn, NumericPtrColumn, NumericColumn, RealPtrColumn, RealColumn, DoublePrecisionPtrColumn, DoublePrecisionColumn, SmallserialColumn, SerialColumn, BigserialColumn, VarCharPtrColumn, VarCharColumn, CharPtrColumn, CharColumn, TextPtrColumn, TextColumn, ByteaPtrColumn, ByteaColumn, TimestampzPtrColumn, TimestampzColumn, TimestampPtrColumn, TimestampColumn, DatePtrColumn, DateColumn, TimezPtrColumn, TimezColumn, TimePtrColumn, TimeColumn, IntervalPtrColumn, IntervalColumn, BooleanPtrColumn, BooleanColumn, PointPtrColumn, BitPtrColumn, BitColumn, BitVaryingPtrColumn, BitVaryingColumn, TsvectorPtrColumn, TsvectorColumn, UUIDPtrColumn, UUIDColumn, XMLPtrColumn, XMLColumn, JSONPtrColumn, JSONColumn, JsonbPtrColumn, JsonbColumn, IntegerArrayPtrColumn, IntegerArrayColumn, TextArrayPtrColumn, TextArrayColumn, JsonbArrayColumn, TextMultiDimArrayPtrColumn, TextMultiDimArrayColumn},
 	}
 }
 `
diff --git a/tests/postgres/insert_test.go b/tests/postgres/insert_test.go
index ecbd3c5..38c135e 100644
--- a/tests/postgres/insert_test.go
+++ b/tests/postgres/insert_test.go
@@ -2,13 +2,11 @@ package postgres
 
 import (
 	"context"
-	"github.com/go-jet/jet/internal/jet"
 	"github.com/go-jet/jet/internal/testutils"
 	. "github.com/go-jet/jet/postgres"
 	"github.com/go-jet/jet/tests/.gentestdata/jetdb/test_sample/model"
 	. "github.com/go-jet/jet/tests/.gentestdata/jetdb/test_sample/table"
 	"github.com/stretchr/testify/assert"
-	"math/rand"
 	"testing"
 	"time"
 )
@@ -17,10 +15,10 @@ func TestInsertValues(t *testing.T) {
 	cleanUpLinkTable(t)
 
 	var expectedSQL = `
-INSERT INTO test_sample.link (id, url, name, description)
-VALUES (100, 'http://www.postgresqltutorial.com', 'PostgreSQL Tutorial', DEFAULT),
-       (101, 'http://www.google.com', 'Google', DEFAULT),
-       (102, 'http://www.yahoo.com', 'Yahoo', NULL)
+INSERT INTO test_sample.link (id, url, name, description) VALUES
+     (100, 'http://www.postgresqltutorial.com', 'PostgreSQL Tutorial', DEFAULT),
+     (101, 'http://www.google.com', 'Google', DEFAULT),
+     (102, 'http://www.yahoo.com', 'Yahoo', NULL)
 RETURNING link.id AS "link.id",
           link.url AS "link.url",
           link.name AS "link.name",
@@ -79,8 +77,8 @@ func TestInsertEmptyColumnList(t *testing.T) {
 	cleanUpLinkTable(t)
 
 	expectedSQL := `
-INSERT INTO test_sample.link
-VALUES (100, 'http://www.postgresqltutorial.com', 'PostgreSQL Tutorial', DEFAULT);
+INSERT INTO test_sample.link VALUES
+     (100, 'http://www.postgresqltutorial.com', 'PostgreSQL Tutorial', DEFAULT);
 `
 
 	stmt := Link.INSERT().
@@ -92,128 +90,11 @@ VALUES (100, 'http://www.postgresqltutorial.com', 'PostgreSQL Tutorial', DEFAULT
 	AssertExec(t, stmt, 1)
 }
 
-func TestInsertOnConflict(t *testing.T) {
-
-	t.Run("do nothing", func(t *testing.T) {
-		employee := model.Employee{EmployeeID: rand.Int31()}
-
-		stmt := Employee.INSERT(Employee.AllColumns).
-			MODEL(employee).
-			MODEL(employee).
-			ON_CONFLICT(Employee.EmployeeID).DO_NOTHING()
-
-		testutils.AssertStatementSql(t, stmt, `
-INSERT INTO test_sample.employee (employee_id, first_name, last_name, employment_date, manager_id)
-VALUES ($1, $2, $3, $4, $5),
-       ($6, $7, $8, $9, $10)
-ON CONFLICT (employee_id) DO NOTHING;
-`)
-		AssertExec(t, stmt, 1)
-	})
-
-	t.Run("on constraint do nothing", func(t *testing.T) {
-		employee := model.Employee{EmployeeID: rand.Int31()}
-
-		stmt := Employee.INSERT(Employee.AllColumns).
-			MODEL(employee).
-			MODEL(employee).
-			ON_CONFLICT().ON_CONSTRAINT("employee_pkey").DO_NOTHING()
-
-		testutils.AssertStatementSql(t, stmt, `
-INSERT INTO test_sample.employee (employee_id, first_name, last_name, employment_date, manager_id)
-VALUES ($1, $2, $3, $4, $5),
-       ($6, $7, $8, $9, $10)
-ON CONFLICT ON CONSTRAINT employee_pkey DO NOTHING;
-`)
-		AssertExec(t, stmt, 1)
-	})
-
-	t.Run("do update", func(t *testing.T) {
-		cleanUpLinkTable(t)
-		stmt := Link.INSERT(Link.ID, Link.URL, Link.Name, Link.Description).
-			VALUES(100, "http://www.postgresqltutorial.com", "PostgreSQL Tutorial", DEFAULT).
-			VALUES(200, "http://www.postgresqltutorial.com", "PostgreSQL Tutorial", DEFAULT).
-			ON_CONFLICT(Link.ID).DO_UPDATE(
-			SET(Link.ID, Link.EXCLUDED.ID).
-				SET(Link.URL, "http://www.postgresqltutorial2.com"),
-		).
-			RETURNING(Link.AllColumns)
-
-		testutils.AssertStatementSql(t, stmt, `
-INSERT INTO test_sample.link (id, url, name, description)
-VALUES ($1, $2, $3, DEFAULT),
-       ($4, $5, $6, DEFAULT)
-ON CONFLICT (id) DO UPDATE
-       SET id = excluded.id,
-           url = $7
-RETURNING link.id AS "link.id",
-          link.url AS "link.url",
-          link.name AS "link.name",
-          link.description AS "link.description";
-`)
-
-		AssertExec(t, stmt, 2)
-	})
-
-	t.Run("on constraint do update", func(t *testing.T) {
-		cleanUpLinkTable(t)
-		stmt := Link.INSERT(Link.ID, Link.URL, Link.Name, Link.Description).
-			VALUES(100, "http://www.postgresqltutorial.com", "PostgreSQL Tutorial", DEFAULT).
-			VALUES(200, "http://www.postgresqltutorial.com", "PostgreSQL Tutorial", DEFAULT).
-			ON_CONFLICT().ON_CONSTRAINT("link_pkey").DO_UPDATE(
-			SET(Link.ID, Link.EXCLUDED.ID).
-				SET(Link.URL, "http://www.postgresqltutorial2.com"),
-		).
-			RETURNING(Link.AllColumns)
-
-		testutils.AssertStatementSql(t, stmt, `
-INSERT INTO test_sample.link (id, url, name, description)
-VALUES ($1, $2, $3, DEFAULT),
-       ($4, $5, $6, DEFAULT)
-ON CONFLICT ON CONSTRAINT link_pkey DO UPDATE
-       SET id = excluded.id,
-           url = $7
-RETURNING link.id AS "link.id",
-          link.url AS "link.url",
-          link.name AS "link.name",
-          link.description AS "link.description";
-`)
-
-		AssertExec(t, stmt, 2)
-	})
-
-	t.Run("do update complex", func(t *testing.T) {
-		cleanUpLinkTable(t)
-
-		stmt := Link.INSERT(Link.ID, Link.URL, Link.Name, Link.Description).
-			VALUES(100, "http://www.postgresqltutorial.com", "PostgreSQL Tutorial", DEFAULT).
-			ON_CONFLICT(Link.ID).WHERE(Link.ID.MUL(Int(2)).GT(Int(10))).DO_UPDATE(
-			SET(Link.ID, SELECT(MAXi(Link.ID).ADD(Int(1))).FROM(Link)).
-				SET(ColumnList{Link.Name, Link.Description}, jet.ROW(Link.EXCLUDED.Name, String("new description"))).
-				WHERE(Link.Description.IS_NOT_NULL()),
-		)
-
-		testutils.AssertDebugStatementSql(t, stmt, `
-INSERT INTO test_sample.link (id, url, name, description)
-VALUES (100, 'http://www.postgresqltutorial.com', 'PostgreSQL Tutorial', DEFAULT)
-ON CONFLICT (id) WHERE (id * 2) > 10 DO UPDATE
-       SET id = (
-                SELECT MAX(link.id) + 1
-                FROM test_sample.link
-           ),
-           (name, description) = ROW(excluded.name, 'new description')
-       WHERE link.description IS NOT NULL;
-`)
-
-		AssertExec(t, stmt, 1)
-	})
-}
-
 func TestInsertModelObject(t *testing.T) {
 	cleanUpLinkTable(t)
 	var expectedSQL = `
-INSERT INTO test_sample.link (url, name)
-VALUES ('http://www.duckduckgo.com', 'Duck Duck go');
+INSERT INTO test_sample.link (url, name) VALUES
+     ('http://www.duckduckgo.com', 'Duck Duck go');
 `
 
 	linkData := model.Link{
@@ -233,8 +114,8 @@ VALUES ('http://www.duckduckgo.com', 'Duck Duck go');
 func TestInsertModelObjectEmptyColumnList(t *testing.T) {
 	cleanUpLinkTable(t)
 	var expectedSQL = `
-INSERT INTO test_sample.link
-VALUES (1000, 'http://www.duckduckgo.com', 'Duck Duck go', NULL);
+INSERT INTO test_sample.link VALUES
+     (1000, 'http://www.duckduckgo.com', 'Duck Duck go', NULL);
 `
 
 	linkData := model.Link{
@@ -254,10 +135,10 @@ VALUES (1000, 'http://www.duckduckgo.com', 'Duck Duck go', NULL);
 
 func TestInsertModelsObject(t *testing.T) {
 	expectedSQL := `
-INSERT INTO test_sample.link (url, name)
-VALUES ('http://www.postgresqltutorial.com', 'PostgreSQL Tutorial'),
-       ('http://www.google.com', 'Google'),
-       ('http://www.yahoo.com', 'Yahoo');
+INSERT INTO test_sample.link (url, name) VALUES
+     ('http://www.postgresqltutorial.com', 'PostgreSQL Tutorial'),
+     ('http://www.google.com', 'Google'),
+     ('http://www.yahoo.com', 'Yahoo');
 `
 
 	tutorial := model.Link{
@@ -289,11 +170,11 @@ VALUES ('http://www.postgresqltutorial.com', 'PostgreSQL Tutorial'),
 
 func TestInsertUsingMutableColumns(t *testing.T) {
 	var expectedSQL = `
-INSERT INTO test_sample.link (url, name, description)
-VALUES ('http://www.postgresqltutorial.com', 'PostgreSQL Tutorial', DEFAULT),
-       ('http://www.google.com', 'Google', NULL),
-       ('http://www.google.com', 'Google', NULL),
-       ('http://www.yahoo.com', 'Yahoo', NULL);
+INSERT INTO test_sample.link (url, name, description) VALUES
+     ('http://www.postgresqltutorial.com', 'PostgreSQL Tutorial', DEFAULT),
+     ('http://www.google.com', 'Google', NULL),
+     ('http://www.google.com', 'Google', NULL),
+     ('http://www.yahoo.com', 'Yahoo', NULL);
 `
 
 	google := model.Link{
diff --git a/tests/postgres/main_test.go b/tests/postgres/main_test.go
index fd538d6..49ab868 100644
--- a/tests/postgres/main_test.go
+++ b/tests/postgres/main_test.go
@@ -5,19 +5,16 @@ import (
 	"github.com/go-jet/jet/tests/dbconfig"
 	_ "github.com/lib/pq"
 	"github.com/pkg/profile"
-	"math/rand"
 	"os"
 	"os/exec"
 	"strings"
 	"testing"
-	"time"
 )
 
 var db *sql.DB
 var testRoot string
 
 func TestMain(m *testing.M) {
-	rand.Seed(time.Now().Unix())
 	defer profile.Start().Stop()
 
 	setTestRoot()
diff --git a/tests/postgres/sample_test.go b/tests/postgres/sample_test.go
index b2bed1d..2cfbc85 100644
--- a/tests/postgres/sample_test.go
+++ b/tests/postgres/sample_test.go
@@ -7,7 +7,6 @@ import (
 	. "github.com/go-jet/jet/tests/.gentestdata/jetdb/test_sample/table"
 	"github.com/google/uuid"
 	"github.com/stretchr/testify/assert"
-	"github.com/stretchr/testify/require"
 	"testing"
 )
 
@@ -222,10 +221,6 @@ FROM test_sample.person;
 
 func TestSelecSelfJoin1(t *testing.T) {
 
-	// clean up
-	_, err := Employee.DELETE().WHERE(Employee.EmployeeID.GT(Int(100))).Exec(db)
-	require.NoError(t, err)
-
 	var expectedSQL = `
 SELECT employee.employee_id AS "employee.employee_id",
      employee.first_name AS "employee.first_name",
@@ -261,7 +256,7 @@ ORDER BY employee.employee_id;
 		Manager *Manager
 	}
 
-	err = query.Query(db, &dest)
+	err := query.Query(db, &dest)
 
 	assert.NoError(t, err)
 	assert.Equal(t, len(dest), 8)
diff --git a/tests/postgres/util_test.go b/tests/postgres/util_test.go
index c30a365..e7a7816 100644
--- a/tests/postgres/util_test.go
+++ b/tests/postgres/util_test.go
@@ -6,14 +6,13 @@ import (
 	"github.com/go-jet/jet/tests/.gentestdata/jetdb/dvds/model"
 	"github.com/google/uuid"
 	"github.com/stretchr/testify/assert"
-	"github.com/stretchr/testify/require"
 	"testing"
 )
 
 func AssertExec(t *testing.T, stmt jet.Statement, rowsAffected int64) {
 	res, err := stmt.Exec(db)
 
-	require.NoError(t, err)
+	assert.NoError(t, err)
 	rows, err := res.RowsAffected()
 	assert.NoError(t, err)
 	assert.Equal(t, rows, rowsAffected)