Skip to content

Commit

Permalink
Added functions to enable and disable prepared statements
Browse files Browse the repository at this point in the history
  • Loading branch information
nadiamoe committed Jan 29, 2018
1 parent 6ec9430 commit 75a6119
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions store.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,24 @@ func (s *Store) DebugWith(logger LoggerFunc) *Store {
}).init()
}

// DisableCacher turns off prepared statements.
func (s *Store) DisableCacher() *Store {
return (&Store{
db: s.db,
logger: s.logger,
useCacher: false,
}).init()
}

// EnableCacher turns on prepared statements. This is the default.
func (s *Store) EnableCacher() *Store {
return (&Store{
db: s.db,
logger: s.logger,
useCacher: true,
}).init()
}

// Insert insert the given record in the table, returns error if no-new
// record is given. The record id is set if it's empty.
func (s *Store) Insert(schema Schema, record Record) error {
Expand Down

0 comments on commit 75a6119

Please sign in to comment.