From 24b29cadf65cff122dd4a336448415972e4609f4 Mon Sep 17 00:00:00 2001 From: Ian Norden Date: Sat, 30 May 2020 12:20:00 -0500 Subject: [PATCH] minor changes --- batch.go | 2 +- database.go | 6 +++--- iterator.go | 2 +- util.go | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/batch.go b/batch.go index 12e7db1..d96ae25 100644 --- a/batch.go +++ b/batch.go @@ -14,7 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -package ipfseth +package ipfsethdb import ( "github.com/ethereum/go-ethereum/ethdb" diff --git a/database.go b/database.go index 0fe2e50..e8d9028 100644 --- a/database.go +++ b/database.go @@ -14,7 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -package ipfseth +package ipfsethdb import ( "errors" @@ -32,6 +32,7 @@ var ( getPgStr = "SELECT data FROM public.blocks WHERE key = $1" putPgStr = "INSERT INTO public.blocks (key, data) VALUES ($1, $2) ON CONFLICT (key) DO NOTHING" deletePgStr = "DELETE FROM public.blocks WHERE key = $1" + dbSizePgStr = "SELECT pg_database_size(current_database())" ) type Database struct { @@ -145,9 +146,8 @@ func (d *Database) Stat(property string) (string, error) { } switch prop { case Size: - pgStr := "SELECT pg_database_size(current_database())" var byteSize string - return byteSize, d.db.Get(&byteSize, pgStr) + return byteSize, d.db.Get(&byteSize, dbSizePgStr) case Idle: return string(d.db.Stats().Idle), nil case InUse: diff --git a/iterator.go b/iterator.go index 473d87b..1e325b2 100644 --- a/iterator.go +++ b/iterator.go @@ -14,7 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -package ipfseth +package ipfsethdb import ( "github.com/ethereum/go-ethereum/ethdb" diff --git a/util.go b/util.go index cef9a72..758a9ea 100644 --- a/util.go +++ b/util.go @@ -14,7 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -package ipfseth +package ipfsethdb import ( "github.com/ipfs/go-ipfs-blockstore"