aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Magorsch <arzano@gentoo.org>2020-06-23 19:56:59 +0200
committerMax Magorsch <arzano@gentoo.org>2020-06-23 19:56:59 +0200
commit12e5c219fda89cfea42d8e1f246834178c94bec0 (patch)
tree4a8301fd5982f06b7ba8ba75ec24146174392555
parentSpeed up the computation of the index page (diff)
downloadarchives-12e5c219fda89cfea42d8e1f246834178c94bec0.tar.gz
archives-12e5c219fda89cfea42d8e1f246834178c94bec0.tar.bz2
archives-12e5c219fda89cfea42d8e1f246834178c94bec0.zip
Speed up the tableExists check
Signed-off-by: Max Magorsch <arzano@gentoo.org>
-rw-r--r--pkg/database/connection.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/database/connection.go b/pkg/database/connection.go
index 06514df..1163679 100644
--- a/pkg/database/connection.go
+++ b/pkg/database/connection.go
@@ -80,6 +80,6 @@ func Connect() {
// utility methods
func tableExists(tableName string) bool {
- _, err := DBCon.Exec("select * from " + tableName + ";")
+ _, err := DBCon.Exec("select * from " + tableName + " limit 1;")
return err == nil
}