2013-06-04 08:56:59 +00:00
|
|
|
package xorm
|
|
|
|
|
|
|
|
type sqlite3 struct {
|
|
|
|
}
|
|
|
|
|
2013-07-03 03:49:29 +00:00
|
|
|
func (db *sqlite3) SqlType(c *Column) string {
|
2013-08-08 16:03:33 +00:00
|
|
|
switch t := c.SQLType.Name; t {
|
2013-08-08 05:24:38 +00:00
|
|
|
case Date, DateTime, TimeStamp, Time:
|
2013-08-08 16:03:33 +00:00
|
|
|
return Numeric
|
2013-08-08 05:24:38 +00:00
|
|
|
case Char, Varchar, TinyText, Text, MediumText, LongText:
|
2013-08-08 16:03:33 +00:00
|
|
|
return Text
|
2013-08-08 05:24:38 +00:00
|
|
|
case Bit, TinyInt, SmallInt, MediumInt, Int, Integer, BigInt, Bool:
|
2013-08-08 16:03:33 +00:00
|
|
|
return Integer
|
2013-08-08 05:24:38 +00:00
|
|
|
case Float, Double, Real:
|
2013-08-08 16:03:33 +00:00
|
|
|
return Real
|
2013-08-08 05:24:38 +00:00
|
|
|
case Decimal, Numeric:
|
2013-08-08 16:03:33 +00:00
|
|
|
return Numeric
|
2013-08-08 05:24:38 +00:00
|
|
|
case TinyBlob, Blob, MediumBlob, LongBlob, Bytea, Binary, VarBinary:
|
2013-08-08 16:03:33 +00:00
|
|
|
return Blob
|
2013-08-08 05:24:38 +00:00
|
|
|
case Serial, BigSerial:
|
2013-08-08 16:03:33 +00:00
|
|
|
c.IsPrimaryKey = true
|
2013-08-08 05:24:38 +00:00
|
|
|
c.IsAutoIncrement = true
|
2013-08-08 16:03:33 +00:00
|
|
|
c.Nullable = false
|
|
|
|
return Integer
|
2013-06-04 08:56:59 +00:00
|
|
|
default:
|
2013-08-08 16:03:33 +00:00
|
|
|
return t
|
2013-06-04 08:56:59 +00:00
|
|
|
}
|
|
|
|
}
|
2013-07-03 03:49:29 +00:00
|
|
|
|
|
|
|
func (db *sqlite3) SupportInsertMany() bool {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
2013-08-08 05:24:38 +00:00
|
|
|
func (db *sqlite3) QuoteStr() string {
|
2013-07-03 03:49:29 +00:00
|
|
|
return "`"
|
|
|
|
}
|
|
|
|
|
2013-08-08 05:24:38 +00:00
|
|
|
func (db *sqlite3) AutoIncrStr() string {
|
2013-07-03 03:49:29 +00:00
|
|
|
return "AUTOINCREMENT"
|
|
|
|
}
|
2013-08-08 05:24:38 +00:00
|
|
|
|
|
|
|
func (db *sqlite3) SupportEngine() bool {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
func (db *sqlite3) SupportCharset() bool {
|
|
|
|
return false
|
|
|
|
}
|