Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
Upgraded deps, fix for datastore gorm issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mrz1836 committed May 2, 2022
1 parent 100a48b commit 3ba89d7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
8 changes: 6 additions & 2 deletions datastore/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,12 @@ func (c *Client) GetModel(
// Get the model data using a select
// todo: optimize by specific fields
var tx *gorm.DB
if forceWriteDB { // Use the "write" database for this query
tx = ctxDB.Clauses(dbresolver.Write).Select("*")
if forceWriteDB { // Use the "write" database for this query (Only MySQL and Postgres)
if c.Engine() == MySQL || c.Engine() == PostgreSQL {
tx = ctxDB.Clauses(dbresolver.Write).Select("*")
} else {
tx = ctxDB.Select("*")
}
} else { // Use a replica if found
tx = ctxDB.Select("*")
}
Expand Down
3 changes: 0 additions & 3 deletions go.mod

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 3 additions & 6 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3ba89d7

Please sign in to comment.