Skip to content

Commit 75a6119

Browse files
committed
Added functions to enable and disable prepared statements
1 parent 6ec9430 commit 75a6119

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

store.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,24 @@ func (s *Store) DebugWith(logger LoggerFunc) *Store {
159159
}).init()
160160
}
161161

162+
// DisableCacher turns off prepared statements.
163+
func (s *Store) DisableCacher() *Store {
164+
return (&Store{
165+
db: s.db,
166+
logger: s.logger,
167+
useCacher: false,
168+
}).init()
169+
}
170+
171+
// EnableCacher turns on prepared statements. This is the default.
172+
func (s *Store) EnableCacher() *Store {
173+
return (&Store{
174+
db: s.db,
175+
logger: s.logger,
176+
useCacher: true,
177+
}).init()
178+
}
179+
162180
// Insert insert the given record in the table, returns error if no-new
163181
// record is given. The record id is set if it's empty.
164182
func (s *Store) Insert(schema Schema, record Record) error {

0 commit comments

Comments
 (0)