You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: db_tables.go
    path of file: ./repos/beego/client/orm
    
    the code of the file until where you have to start completion: // Copyright 2014 beego Author. All Rights Reser
    
func (t *dbTables) getJoinSQL() (join string) {
	Q := t.base.TableQuote()

	for _, jt := range t.tables {
		if jt.inner {
			join += "INNER JOIN "
		} else {
			join += "LEFT OUTER JOIN "
		}
		var (
			table  string
			t1, t2 string
			c1, c2 string
		)
		t1 = "T0"
		if jt.jtl != nil {
			t1 = jt.jtl.index
		}
		t2 = jt.index
		table = jt.mi.Table

		switch {
		case jt.fi.FieldType == RelManyToMany || jt.fi.FieldType == RelReverseMany || jt.fi.Reverse && jt.fi.ReverseFieldInfo.FieldType == RelManyToMany:
			c1 = jt.fi.Mi.Fields.Pk.Column
			for _, ffi := range jt.mi.Fields.FieldsRel {
				if jt.fi.Mi == ffi.RelModelInfo {
					c2 = ffi.Column
					break
				}
			}
		default:
			c1 = jt.fi.Column
			c2 = jt.fi.RelModelInfo.Fields.Pk.Column

			if jt.fi.Reverse {
				c1 = jt.mi.Fields.Pk.Column
				c2 = jt.fi.ReverseFieldInfo.Column
			}
		}

		join += fmt.Sprintf("%s%s%s %s ON %s.%s%s%s = %s.%s%s%s ", Q, table, Q, t2,
			t2, Q, c2, Q, t1, Q, c1, Q)
	}
	return
}