orm add full regular go type support, such as int8, uint8, byte, rune. add date/datetime timezone support very well.

This commit is contained in:
slene
2013-08-13 17:16:12 +08:00
parent deb00809a5
commit 27b84841a7
17 changed files with 527 additions and 107 deletions

View File

@@ -1,5 +1,9 @@
package orm
import (
"fmt"
)
var sqliteOperators = map[string]string{
"exact": "= ?",
"iexact": "LIKE ? ESCAPE '\\'",
@@ -25,6 +29,12 @@ func (d *dbBaseSqlite) OperatorSql(operator string) string {
return sqliteOperators[operator]
}
func (d *dbBaseSqlite) GenerateOperatorLeftCol(fi *fieldInfo, operator string, leftCol *string) {
if fi.fieldType == TypeDateField {
*leftCol = fmt.Sprintf("DATE(%s)", *leftCol)
}
}
func (d *dbBaseSqlite) SupportUpdateJoin() bool {
return false
}