Exemple #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
}
Exemple #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
}
Exemple #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
}
Exemple #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
}
Exemple #5
0
func (this *GenericTranslator) ColumnName(column *db.Column) string {
	return column.GetName()
}
func (this *FirebirdSQLTranslator) ColumnName(column *db.Column) string {
	return "\"" + strings.ToUpper(column.GetName()) + "\""
}
func (this *FirebirdSQLTranslator) GetAutoNumberQuery(column *db.Column) string {
	return "select GEN_ID(" + column.GetTable().GetName() + "_GEN, 1) from RDB$DATABASE"
}
Exemple #8
0
func (this *MySQL5Translator) ColumnName(column *db.Column) string {
	return "`" + strings.ToUpper(column.GetName()) + "`"
}
Exemple #9
0
func (this *OracleTranslator) ColumnName(column *db.Column) string {
	return "\"" + strings.ToUpper(column.GetName()) + "\""
}
Exemple #10
0
func (this *OracleTranslator) GetAutoNumberQuery(column *db.Column) string {
	return "select " + strings.ToUpper(column.GetTable().GetName()) + "_SEQ.nextval from dual"
}
func (this *PostgreSQLTranslator) ColumnName(column *db.Column) string {
	return strings.ToLower(column.GetName())
}