Add qty functions to services

This commit is contained in:
Luis Eduardo Jeréz Girón
2024-07-24 10:27:26 -06:00
parent 8e5a804a41
commit ab14a8bd50
8 changed files with 36 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
package backups
import "context"
func (s *Service) GetBackupsQty(ctx context.Context) (int64, error) {
return s.dbgen.BackupsServiceGetBackupsQty(ctx)
}

View File

@@ -0,0 +1,2 @@
-- name: BackupsServiceGetBackupsQty :one
SELECT COUNT(*) FROM backups;

View File

@@ -0,0 +1,7 @@
package databases
import "context"
func (s *Service) GetDatabasesQty(ctx context.Context) (int64, error) {
return s.dbgen.DatabasesServiceGetDatabasesQty(ctx)
}

View File

@@ -0,0 +1,2 @@
-- name: DatabasesServiceGetDatabasesQty :one
SELECT COUNT(*) FROM databases;

View File

@@ -0,0 +1,7 @@
package destinations
import "context"
func (s *Service) GetDestinationsQty(ctx context.Context) (int64, error) {
return s.dbgen.DestinationsServiceGetDestinationsQty(ctx)
}

View File

@@ -0,0 +1,2 @@
-- name: DestinationsServiceGetDestinationsQty :one
SELECT COUNT(*) FROM destinations;

View File

@@ -0,0 +1,7 @@
package executions
import "context"
func (s *Service) GetExecutionsQty(ctx context.Context) (int64, error) {
return s.dbgen.ExecutionsServiceGetExecutionsQty(ctx)
}

View File

@@ -0,0 +1,2 @@
-- name: ExecutionsServiceGetExecutionsQty :one
SELECT COUNT(*) FROM executions;