Пример #1
0
func AddRangeCriteria(conditions []*db.Criteria, column *db.Column, leftBound interface{}, rightBound interface{}) ([]*db.Criteria, bool) {
	if !IsNil(leftBound) || !IsNil(rightBound) {
		conditions = append(conditions, column.Range(leftBound, rightBound))
		return conditions, true
	}
	return conditions, false
}
Пример #2
0
func AddWildNoCaseCriteria(conditions []*db.Criteria, column *db.Column, value *string) ([]*db.Criteria, bool) {
	if !IsEmpty(value) {
		conditions = append(conditions, column.ILike("%"+*value+"%"))
		return conditions, true
	}
	return conditions, false
}
Пример #3
0
func AddEqualCriteria(conditions []*db.Criteria, column *db.Column, value interface{}) ([]*db.Criteria, bool) {
	if !IsNil(value) {
		conditions = append(conditions, column.Matches(value))
		return conditions, true
	}
	return conditions, false
}
Пример #4
0
func AddNoCaseCriteria(conditions []*db.Criteria, column *db.Column, value *string) ([]*db.Criteria, bool) {
	if !IsEmpty(value) {
		var criteria *db.Criteria
		if HasWildcards(value) {
			criteria = column.ILike(value)
		} else {
			criteria = column.IMatches(value)
		}
		conditions = append(conditions, criteria)
		return conditions, true
	}
	return conditions, false
}
Пример #5
0
func (this *GenericTranslator) ColumnName(column *db.Column) string {
	return column.GetName()
}
Пример #6
0
func (this *FirebirdSQLTranslator) ColumnName(column *db.Column) string {
	return "\"" + strings.ToUpper(column.GetName()) + "\""
}
Пример #7
0
func (this *FirebirdSQLTranslator) GetAutoNumberQuery(column *db.Column) string {
	return "select GEN_ID(" + column.GetTable().GetName() + "_GEN, 1) from RDB$DATABASE"
}
Пример #8
0
func (this *MySQL5Translator) ColumnName(column *db.Column) string {
	return "`" + strings.ToUpper(column.GetName()) + "`"
}
Пример #9
0
func (this *OracleTranslator) ColumnName(column *db.Column) string {
	return "\"" + strings.ToUpper(column.GetName()) + "\""
}
Пример #10
0
func (this *OracleTranslator) GetAutoNumberQuery(column *db.Column) string {
	return "select " + strings.ToUpper(column.GetTable().GetName()) + "_SEQ.nextval from dual"
}
Пример #11
0
func (this *PostgreSQLTranslator) ColumnName(column *db.Column) string {
	return strings.ToLower(column.GetName())
}