mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 00:35:15 +00:00
service: use upper case sql keywords
This commit is contained in:
parent
f29e8bd6d2
commit
7add014a2b
|
@ -318,7 +318,7 @@ func (s *BacktestService) BatchInsert(kline []types.KLine) error {
|
||||||
tableName := s._targetKlineTable(kline[0].Exchange)
|
tableName := s._targetKlineTable(kline[0].Exchange)
|
||||||
|
|
||||||
sql := fmt.Sprintf("INSERT INTO `%s` (`exchange`, `start_time`, `end_time`, `symbol`, `interval`, `open`, `high`, `low`, `close`, `closed`, `volume`, `quote_volume`, `taker_buy_base_volume`, `taker_buy_quote_volume`)"+
|
sql := fmt.Sprintf("INSERT INTO `%s` (`exchange`, `start_time`, `end_time`, `symbol`, `interval`, `open`, `high`, `low`, `close`, `closed`, `volume`, `quote_volume`, `taker_buy_base_volume`, `taker_buy_quote_volume`)"+
|
||||||
" values (:exchange, :start_time, :end_time, :symbol, :interval, :open, :high, :low, :close, :closed, :volume, :quote_volume, :taker_buy_base_volume, :taker_buy_quote_volume); ", tableName)
|
" VALUES (:exchange, :start_time, :end_time, :symbol, :interval, :open, :high, :low, :close, :closed, :volume, :quote_volume, :taker_buy_base_volume, :taker_buy_quote_volume); ", tableName)
|
||||||
|
|
||||||
tx := s.DB.MustBegin()
|
tx := s.DB.MustBegin()
|
||||||
if _, err := tx.NamedExec(sql, kline); err != nil {
|
if _, err := tx.NamedExec(sql, kline); err != nil {
|
||||||
|
@ -334,7 +334,7 @@ func (s *BacktestService) _deleteDuplicatedKLine(k types.KLine) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
tableName := s._targetKlineTable(k.Exchange)
|
tableName := s._targetKlineTable(k.Exchange)
|
||||||
sql := fmt.Sprintf("delete from `%s` where gid = :gid ", tableName)
|
sql := fmt.Sprintf("DELETE FROM `%s` WHERE gid = :gid ", tableName)
|
||||||
_, err := s.DB.NamedExec(sql, k)
|
_, err := s.DB.NamedExec(sql, k)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user